ovirtsdk4.readers
1# -*- coding: utf-8 -*- 2 3# 4# Copyright (c) 2016 Red Hat, Inc. 5# 6# Licensed under the Apache License, Version 2.0 (the "License"); 7# you may not use this file except in compliance with the License. 8# You may obtain a copy of the License at 9# 10# http://www.apache.org/licenses/LICENSE-2.0 11# 12# Unless required by applicable law or agreed to in writing, software 13# distributed under the License is distributed on an "AS IS" BASIS, 14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15# See the License for the specific language governing permissions and 16# limitations under the License. 17# 18 19 20from ovirtsdk4 import List 21from ovirtsdk4 import types 22from ovirtsdk4.reader import Reader 23 24 25class ActionReader(Reader): 26 27 def __init__(self): 28 super(ActionReader, self).__init__() 29 30 @staticmethod 31 def read_one(reader): 32 # Do nothing if there aren't more tags: 33 if not reader.forward(): 34 return None 35 36 # Create the object: 37 obj = types.Action() 38 39 # Process the attributes: 40 obj.href = reader.get_attribute('href') 41 value = reader.get_attribute('id') 42 if value is not None: 43 obj.id = value 44 45 # Discard the start tag: 46 empty = reader.empty_element() 47 reader.read() 48 if empty: 49 return obj 50 51 # Process the inner elements: 52 links = [] 53 while reader.forward(): 54 tag = reader.node_name() 55 if tag == 'activate': 56 obj.activate = Reader.read_boolean(reader) 57 elif tag == 'allow_partial_import': 58 obj.allow_partial_import = Reader.read_boolean(reader) 59 elif tag == 'async': 60 obj.async_ = Reader.read_boolean(reader) 61 elif tag == 'attachment': 62 obj.attachment = DiskAttachmentReader.read_one(reader) 63 elif tag == 'authorized_key': 64 obj.authorized_key = AuthorizedKeyReader.read_one(reader) 65 elif tag == 'auto_pinning_policy': 66 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 67 elif tag == 'bricks': 68 obj.bricks = GlusterBrickReader.read_many(reader) 69 elif tag == 'certificates': 70 obj.certificates = CertificateReader.read_many(reader) 71 elif tag == 'check_connectivity': 72 obj.check_connectivity = Reader.read_boolean(reader) 73 elif tag == 'clone': 74 obj.clone = Reader.read_boolean(reader) 75 elif tag == 'clone_permissions': 76 obj.clone_permissions = Reader.read_boolean(reader) 77 elif tag == 'cluster': 78 obj.cluster = ClusterReader.read_one(reader) 79 elif tag == 'collapse_snapshots': 80 obj.collapse_snapshots = Reader.read_boolean(reader) 81 elif tag == 'comment': 82 obj.comment = Reader.read_string(reader) 83 elif tag == 'commit_on_success': 84 obj.commit_on_success = Reader.read_boolean(reader) 85 elif tag == 'connection': 86 obj.connection = StorageConnectionReader.read_one(reader) 87 elif tag == 'connectivity_timeout': 88 obj.connectivity_timeout = Reader.read_integer(reader) 89 elif tag == 'correlation_id': 90 obj.correlation_id = Reader.read_string(reader) 91 elif tag == 'data_center': 92 obj.data_center = DataCenterReader.read_one(reader) 93 elif tag == 'deploy_hosted_engine': 94 obj.deploy_hosted_engine = Reader.read_boolean(reader) 95 elif tag == 'description': 96 obj.description = Reader.read_string(reader) 97 elif tag == 'details': 98 obj.details = GlusterVolumeProfileDetailsReader.read_one(reader) 99 elif tag == 'directory': 100 obj.directory = Reader.read_string(reader) 101 elif tag == 'discard_snapshots': 102 obj.discard_snapshots = Reader.read_boolean(reader) 103 elif tag == 'discovered_targets': 104 obj.discovered_targets = IscsiDetailsReader.read_many(reader) 105 elif tag == 'disk': 106 obj.disk = DiskReader.read_one(reader) 107 elif tag == 'disk_profile': 108 obj.disk_profile = DiskProfileReader.read_one(reader) 109 elif tag == 'disks': 110 obj.disks = DiskReader.read_many(reader) 111 elif tag == 'exclusive': 112 obj.exclusive = Reader.read_boolean(reader) 113 elif tag == 'fault': 114 obj.fault = FaultReader.read_one(reader) 115 elif tag == 'fence_type': 116 obj.fence_type = Reader.read_string(reader) 117 elif tag == 'filename': 118 obj.filename = Reader.read_string(reader) 119 elif tag == 'filter': 120 obj.filter = Reader.read_boolean(reader) 121 elif tag == 'fix_layout': 122 obj.fix_layout = Reader.read_boolean(reader) 123 elif tag == 'follow': 124 obj.follow = Reader.read_string(reader) 125 elif tag == 'force': 126 obj.force = Reader.read_boolean(reader) 127 elif tag == 'grace_period': 128 obj.grace_period = GracePeriodReader.read_one(reader) 129 elif tag == 'host': 130 obj.host = HostReader.read_one(reader) 131 elif tag == 'image': 132 obj.image = Reader.read_string(reader) 133 elif tag == 'image_transfer': 134 obj.image_transfer = ImageTransferReader.read_one(reader) 135 elif tag == 'import_as_template': 136 obj.import_as_template = Reader.read_boolean(reader) 137 elif tag == 'is_attached': 138 obj.is_attached = Reader.read_boolean(reader) 139 elif tag == 'iscsi': 140 obj.iscsi = IscsiDetailsReader.read_one(reader) 141 elif tag == 'iscsi_targets': 142 obj.iscsi_targets = Reader.read_strings(reader) 143 elif tag == 'job': 144 obj.job = JobReader.read_one(reader) 145 elif tag == 'lease': 146 obj.lease = StorageDomainLeaseReader.read_one(reader) 147 elif tag == 'logical_units': 148 obj.logical_units = LogicalUnitReader.read_many(reader) 149 elif tag == 'maintenance_after_restart': 150 obj.maintenance_after_restart = Reader.read_boolean(reader) 151 elif tag == 'maintenance_enabled': 152 obj.maintenance_enabled = Reader.read_boolean(reader) 153 elif tag == 'migrate_vms_in_affinity_closure': 154 obj.migrate_vms_in_affinity_closure = Reader.read_boolean(reader) 155 elif tag == 'modified_bonds': 156 obj.modified_bonds = HostNicReader.read_many(reader) 157 elif tag == 'modified_labels': 158 obj.modified_labels = NetworkLabelReader.read_many(reader) 159 elif tag == 'modified_network_attachments': 160 obj.modified_network_attachments = NetworkAttachmentReader.read_many(reader) 161 elif tag == 'name': 162 obj.name = Reader.read_string(reader) 163 elif tag == 'optimize_cpu_settings': 164 obj.optimize_cpu_settings = Reader.read_boolean(reader) 165 elif tag == 'option': 166 obj.option = OptionReader.read_one(reader) 167 elif tag == 'pause': 168 obj.pause = Reader.read_boolean(reader) 169 elif tag == 'permission': 170 obj.permission = PermissionReader.read_one(reader) 171 elif tag == 'power_management': 172 obj.power_management = PowerManagementReader.read_one(reader) 173 elif tag == 'proxy_ticket': 174 obj.proxy_ticket = ProxyTicketReader.read_one(reader) 175 elif tag == 'quota': 176 obj.quota = QuotaReader.read_one(reader) 177 elif tag == 'reason': 178 obj.reason = Reader.read_string(reader) 179 elif tag == 'reassign_bad_macs': 180 obj.reassign_bad_macs = Reader.read_boolean(reader) 181 elif tag == 'reboot': 182 obj.reboot = Reader.read_boolean(reader) 183 elif tag == 'registration_configuration': 184 obj.registration_configuration = RegistrationConfigurationReader.read_one(reader) 185 elif tag == 'remote_viewer_connection_file': 186 obj.remote_viewer_connection_file = Reader.read_string(reader) 187 elif tag == 'removed_bonds': 188 obj.removed_bonds = HostNicReader.read_many(reader) 189 elif tag == 'removed_labels': 190 obj.removed_labels = NetworkLabelReader.read_many(reader) 191 elif tag == 'removed_network_attachments': 192 obj.removed_network_attachments = NetworkAttachmentReader.read_many(reader) 193 elif tag == 'resolution_type': 194 obj.resolution_type = Reader.read_string(reader) 195 elif tag == 'restore_memory': 196 obj.restore_memory = Reader.read_boolean(reader) 197 elif tag == 'root_password': 198 obj.root_password = Reader.read_string(reader) 199 elif tag == 'seal': 200 obj.seal = Reader.read_boolean(reader) 201 elif tag == 'snapshot': 202 obj.snapshot = SnapshotReader.read_one(reader) 203 elif tag == 'source_host': 204 obj.source_host = HostReader.read_one(reader) 205 elif tag == 'ssh': 206 obj.ssh = SshReader.read_one(reader) 207 elif tag == 'status': 208 obj.status = Reader.read_string(reader) 209 elif tag == 'stop_gluster_service': 210 obj.stop_gluster_service = Reader.read_boolean(reader) 211 elif tag == 'storage_domain': 212 obj.storage_domain = StorageDomainReader.read_one(reader) 213 elif tag == 'storage_domains': 214 obj.storage_domains = StorageDomainReader.read_many(reader) 215 elif tag == 'succeeded': 216 obj.succeeded = Reader.read_boolean(reader) 217 elif tag == 'synchronized_network_attachments': 218 obj.synchronized_network_attachments = NetworkAttachmentReader.read_many(reader) 219 elif tag == 'template': 220 obj.template = TemplateReader.read_one(reader) 221 elif tag == 'ticket': 222 obj.ticket = TicketReader.read_one(reader) 223 elif tag == 'timeout': 224 obj.timeout = Reader.read_integer(reader) 225 elif tag == 'undeploy_hosted_engine': 226 obj.undeploy_hosted_engine = Reader.read_boolean(reader) 227 elif tag == 'upgrade_action': 228 obj.upgrade_action = Reader.read_enum(types.ClusterUpgradeAction, reader) 229 elif tag == 'upgrade_percent_complete': 230 obj.upgrade_percent_complete = Reader.read_integer(reader) 231 elif tag == 'use_cloud_init': 232 obj.use_cloud_init = Reader.read_boolean(reader) 233 elif tag == 'use_ignition': 234 obj.use_ignition = Reader.read_boolean(reader) 235 elif tag == 'use_initialization': 236 obj.use_initialization = Reader.read_boolean(reader) 237 elif tag == 'use_sysprep': 238 obj.use_sysprep = Reader.read_boolean(reader) 239 elif tag == 'virtual_functions_configuration': 240 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 241 elif tag == 'vm': 242 obj.vm = VmReader.read_one(reader) 243 elif tag == 'vnic_profile_mappings': 244 obj.vnic_profile_mappings = VnicProfileMappingReader.read_many(reader) 245 elif tag == 'volatile': 246 obj.volatile = Reader.read_boolean(reader) 247 else: 248 reader.next_element() 249 for link in links: 250 ActionReader._process_link(link, obj) 251 252 # Discard the end tag: 253 reader.read() 254 255 return obj 256 257 @staticmethod 258 def read_many(reader): 259 # Do nothing if there aren't more tags: 260 objs = List() 261 if not reader.forward(): 262 return objs 263 264 # Process the attributes: 265 objs.href = reader.get_attribute('href') 266 267 # Discard the start tag: 268 empty = reader.empty_element() 269 reader.read() 270 if empty: 271 return objs 272 273 # Process the inner elements: 274 while reader.forward(): 275 objs.append(ActionReader.read_one(reader)) 276 277 # Discard the end tag: 278 reader.read() 279 280 return objs 281 282 283class AffinityGroupReader(Reader): 284 285 def __init__(self): 286 super(AffinityGroupReader, self).__init__() 287 288 @staticmethod 289 def read_one(reader): 290 # Do nothing if there aren't more tags: 291 if not reader.forward(): 292 return None 293 294 # Create the object: 295 obj = types.AffinityGroup() 296 297 # Process the attributes: 298 obj.href = reader.get_attribute('href') 299 value = reader.get_attribute('id') 300 if value is not None: 301 obj.id = value 302 303 # Discard the start tag: 304 empty = reader.empty_element() 305 reader.read() 306 if empty: 307 return obj 308 309 # Process the inner elements: 310 links = [] 311 while reader.forward(): 312 tag = reader.node_name() 313 if tag == 'broken': 314 obj.broken = Reader.read_boolean(reader) 315 elif tag == 'cluster': 316 obj.cluster = ClusterReader.read_one(reader) 317 elif tag == 'comment': 318 obj.comment = Reader.read_string(reader) 319 elif tag == 'description': 320 obj.description = Reader.read_string(reader) 321 elif tag == 'enforcing': 322 obj.enforcing = Reader.read_boolean(reader) 323 elif tag == 'host_labels': 324 obj.host_labels = AffinityLabelReader.read_many(reader) 325 elif tag == 'hosts': 326 obj.hosts = HostReader.read_many(reader) 327 elif tag == 'hosts_rule': 328 obj.hosts_rule = AffinityRuleReader.read_one(reader) 329 elif tag == 'name': 330 obj.name = Reader.read_string(reader) 331 elif tag == 'positive': 332 obj.positive = Reader.read_boolean(reader) 333 elif tag == 'priority': 334 obj.priority = Reader.read_decimal(reader) 335 elif tag == 'vm_labels': 336 obj.vm_labels = AffinityLabelReader.read_many(reader) 337 elif tag == 'vms': 338 obj.vms = VmReader.read_many(reader) 339 elif tag == 'vms_rule': 340 obj.vms_rule = AffinityRuleReader.read_one(reader) 341 elif tag == 'link': 342 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 343 reader.next_element() 344 else: 345 reader.next_element() 346 for link in links: 347 AffinityGroupReader._process_link(link, obj) 348 349 # Discard the end tag: 350 reader.read() 351 352 return obj 353 354 @staticmethod 355 def read_many(reader): 356 # Do nothing if there aren't more tags: 357 objs = List() 358 if not reader.forward(): 359 return objs 360 361 # Process the attributes: 362 objs.href = reader.get_attribute('href') 363 364 # Discard the start tag: 365 empty = reader.empty_element() 366 reader.read() 367 if empty: 368 return objs 369 370 # Process the inner elements: 371 while reader.forward(): 372 objs.append(AffinityGroupReader.read_one(reader)) 373 374 # Discard the end tag: 375 reader.read() 376 377 return objs 378 379 @staticmethod 380 def _process_link(link, obj): 381 # Process the attributes: 382 rel = link[0] 383 href = link[1] 384 if href and rel: 385 if rel == "hostlabels": 386 if obj.host_labels is not None: 387 obj.host_labels.href = href 388 else: 389 obj.host_labels = List(href) 390 elif rel == "hosts": 391 if obj.hosts is not None: 392 obj.hosts.href = href 393 else: 394 obj.hosts = List(href) 395 elif rel == "vmlabels": 396 if obj.vm_labels is not None: 397 obj.vm_labels.href = href 398 else: 399 obj.vm_labels = List(href) 400 elif rel == "vms": 401 if obj.vms is not None: 402 obj.vms.href = href 403 else: 404 obj.vms = List(href) 405 406 407class AffinityLabelReader(Reader): 408 409 def __init__(self): 410 super(AffinityLabelReader, self).__init__() 411 412 @staticmethod 413 def read_one(reader): 414 # Do nothing if there aren't more tags: 415 if not reader.forward(): 416 return None 417 418 # Create the object: 419 obj = types.AffinityLabel() 420 421 # Process the attributes: 422 obj.href = reader.get_attribute('href') 423 value = reader.get_attribute('id') 424 if value is not None: 425 obj.id = value 426 427 # Discard the start tag: 428 empty = reader.empty_element() 429 reader.read() 430 if empty: 431 return obj 432 433 # Process the inner elements: 434 links = [] 435 while reader.forward(): 436 tag = reader.node_name() 437 if tag == 'comment': 438 obj.comment = Reader.read_string(reader) 439 elif tag == 'description': 440 obj.description = Reader.read_string(reader) 441 elif tag == 'has_implicit_affinity_group': 442 obj.has_implicit_affinity_group = Reader.read_boolean(reader) 443 elif tag == 'hosts': 444 obj.hosts = HostReader.read_many(reader) 445 elif tag == 'name': 446 obj.name = Reader.read_string(reader) 447 elif tag == 'read_only': 448 obj.read_only = Reader.read_boolean(reader) 449 elif tag == 'vms': 450 obj.vms = VmReader.read_many(reader) 451 elif tag == 'link': 452 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 453 reader.next_element() 454 else: 455 reader.next_element() 456 for link in links: 457 AffinityLabelReader._process_link(link, obj) 458 459 # Discard the end tag: 460 reader.read() 461 462 return obj 463 464 @staticmethod 465 def read_many(reader): 466 # Do nothing if there aren't more tags: 467 objs = List() 468 if not reader.forward(): 469 return objs 470 471 # Process the attributes: 472 objs.href = reader.get_attribute('href') 473 474 # Discard the start tag: 475 empty = reader.empty_element() 476 reader.read() 477 if empty: 478 return objs 479 480 # Process the inner elements: 481 while reader.forward(): 482 objs.append(AffinityLabelReader.read_one(reader)) 483 484 # Discard the end tag: 485 reader.read() 486 487 return objs 488 489 @staticmethod 490 def _process_link(link, obj): 491 # Process the attributes: 492 rel = link[0] 493 href = link[1] 494 if href and rel: 495 if rel == "hosts": 496 if obj.hosts is not None: 497 obj.hosts.href = href 498 else: 499 obj.hosts = List(href) 500 elif rel == "vms": 501 if obj.vms is not None: 502 obj.vms.href = href 503 else: 504 obj.vms = List(href) 505 506 507class AffinityRuleReader(Reader): 508 509 def __init__(self): 510 super(AffinityRuleReader, self).__init__() 511 512 @staticmethod 513 def read_one(reader): 514 # Do nothing if there aren't more tags: 515 if not reader.forward(): 516 return None 517 518 # Create the object: 519 obj = types.AffinityRule() 520 521 # Process the attributes: 522 obj.href = reader.get_attribute('href') 523 524 # Discard the start tag: 525 empty = reader.empty_element() 526 reader.read() 527 if empty: 528 return obj 529 530 # Process the inner elements: 531 links = [] 532 while reader.forward(): 533 tag = reader.node_name() 534 if tag == 'enabled': 535 obj.enabled = Reader.read_boolean(reader) 536 elif tag == 'enforcing': 537 obj.enforcing = Reader.read_boolean(reader) 538 elif tag == 'positive': 539 obj.positive = Reader.read_boolean(reader) 540 else: 541 reader.next_element() 542 for link in links: 543 AffinityRuleReader._process_link(link, obj) 544 545 # Discard the end tag: 546 reader.read() 547 548 return obj 549 550 @staticmethod 551 def read_many(reader): 552 # Do nothing if there aren't more tags: 553 objs = List() 554 if not reader.forward(): 555 return objs 556 557 # Process the attributes: 558 objs.href = reader.get_attribute('href') 559 560 # Discard the start tag: 561 empty = reader.empty_element() 562 reader.read() 563 if empty: 564 return objs 565 566 # Process the inner elements: 567 while reader.forward(): 568 objs.append(AffinityRuleReader.read_one(reader)) 569 570 # Discard the end tag: 571 reader.read() 572 573 return objs 574 575 576class AgentReader(Reader): 577 578 def __init__(self): 579 super(AgentReader, self).__init__() 580 581 @staticmethod 582 def read_one(reader): 583 # Do nothing if there aren't more tags: 584 if not reader.forward(): 585 return None 586 587 # Create the object: 588 obj = types.Agent() 589 590 # Process the attributes: 591 obj.href = reader.get_attribute('href') 592 value = reader.get_attribute('id') 593 if value is not None: 594 obj.id = value 595 596 # Discard the start tag: 597 empty = reader.empty_element() 598 reader.read() 599 if empty: 600 return obj 601 602 # Process the inner elements: 603 links = [] 604 while reader.forward(): 605 tag = reader.node_name() 606 if tag == 'address': 607 obj.address = Reader.read_string(reader) 608 elif tag == 'comment': 609 obj.comment = Reader.read_string(reader) 610 elif tag == 'concurrent': 611 obj.concurrent = Reader.read_boolean(reader) 612 elif tag == 'description': 613 obj.description = Reader.read_string(reader) 614 elif tag == 'encrypt_options': 615 obj.encrypt_options = Reader.read_boolean(reader) 616 elif tag == 'host': 617 obj.host = HostReader.read_one(reader) 618 elif tag == 'name': 619 obj.name = Reader.read_string(reader) 620 elif tag == 'options': 621 obj.options = OptionReader.read_many(reader) 622 elif tag == 'order': 623 obj.order = Reader.read_integer(reader) 624 elif tag == 'password': 625 obj.password = Reader.read_string(reader) 626 elif tag == 'port': 627 obj.port = Reader.read_integer(reader) 628 elif tag == 'type': 629 obj.type = Reader.read_string(reader) 630 elif tag == 'username': 631 obj.username = Reader.read_string(reader) 632 else: 633 reader.next_element() 634 for link in links: 635 AgentReader._process_link(link, obj) 636 637 # Discard the end tag: 638 reader.read() 639 640 return obj 641 642 @staticmethod 643 def read_many(reader): 644 # Do nothing if there aren't more tags: 645 objs = List() 646 if not reader.forward(): 647 return objs 648 649 # Process the attributes: 650 objs.href = reader.get_attribute('href') 651 652 # Discard the start tag: 653 empty = reader.empty_element() 654 reader.read() 655 if empty: 656 return objs 657 658 # Process the inner elements: 659 while reader.forward(): 660 objs.append(AgentReader.read_one(reader)) 661 662 # Discard the end tag: 663 reader.read() 664 665 return objs 666 667 668class AgentConfigurationReader(Reader): 669 670 def __init__(self): 671 super(AgentConfigurationReader, self).__init__() 672 673 @staticmethod 674 def read_one(reader): 675 # Do nothing if there aren't more tags: 676 if not reader.forward(): 677 return None 678 679 # Create the object: 680 obj = types.AgentConfiguration() 681 682 # Process the attributes: 683 obj.href = reader.get_attribute('href') 684 685 # Discard the start tag: 686 empty = reader.empty_element() 687 reader.read() 688 if empty: 689 return obj 690 691 # Process the inner elements: 692 links = [] 693 while reader.forward(): 694 tag = reader.node_name() 695 if tag == 'address': 696 obj.address = Reader.read_string(reader) 697 elif tag == 'broker_type': 698 obj.broker_type = Reader.read_enum(types.MessageBrokerType, reader) 699 elif tag == 'network_mappings': 700 obj.network_mappings = Reader.read_string(reader) 701 elif tag == 'password': 702 obj.password = Reader.read_string(reader) 703 elif tag == 'port': 704 obj.port = Reader.read_integer(reader) 705 elif tag == 'username': 706 obj.username = Reader.read_string(reader) 707 else: 708 reader.next_element() 709 for link in links: 710 AgentConfigurationReader._process_link(link, obj) 711 712 # Discard the end tag: 713 reader.read() 714 715 return obj 716 717 @staticmethod 718 def read_many(reader): 719 # Do nothing if there aren't more tags: 720 objs = List() 721 if not reader.forward(): 722 return objs 723 724 # Process the attributes: 725 objs.href = reader.get_attribute('href') 726 727 # Discard the start tag: 728 empty = reader.empty_element() 729 reader.read() 730 if empty: 731 return objs 732 733 # Process the inner elements: 734 while reader.forward(): 735 objs.append(AgentConfigurationReader.read_one(reader)) 736 737 # Discard the end tag: 738 reader.read() 739 740 return objs 741 742 743class ApiReader(Reader): 744 745 def __init__(self): 746 super(ApiReader, self).__init__() 747 748 @staticmethod 749 def read_one(reader): 750 # Do nothing if there aren't more tags: 751 if not reader.forward(): 752 return None 753 754 # Create the object: 755 obj = types.Api() 756 757 # Process the attributes: 758 obj.href = reader.get_attribute('href') 759 760 # Discard the start tag: 761 empty = reader.empty_element() 762 reader.read() 763 if empty: 764 return obj 765 766 # Process the inner elements: 767 links = [] 768 while reader.forward(): 769 tag = reader.node_name() 770 if tag == 'authenticated_user': 771 obj.authenticated_user = UserReader.read_one(reader) 772 elif tag == 'effective_user': 773 obj.effective_user = UserReader.read_one(reader) 774 elif tag == 'product_info': 775 obj.product_info = ProductInfoReader.read_one(reader) 776 elif tag == 'special_objects': 777 obj.special_objects = SpecialObjectsReader.read_one(reader) 778 elif tag == 'summary': 779 obj.summary = ApiSummaryReader.read_one(reader) 780 elif tag == 'time': 781 obj.time = Reader.read_date(reader) 782 else: 783 reader.next_element() 784 for link in links: 785 ApiReader._process_link(link, obj) 786 787 # Discard the end tag: 788 reader.read() 789 790 return obj 791 792 @staticmethod 793 def read_many(reader): 794 # Do nothing if there aren't more tags: 795 objs = List() 796 if not reader.forward(): 797 return objs 798 799 # Process the attributes: 800 objs.href = reader.get_attribute('href') 801 802 # Discard the start tag: 803 empty = reader.empty_element() 804 reader.read() 805 if empty: 806 return objs 807 808 # Process the inner elements: 809 while reader.forward(): 810 objs.append(ApiReader.read_one(reader)) 811 812 # Discard the end tag: 813 reader.read() 814 815 return objs 816 817 818class ApiSummaryReader(Reader): 819 820 def __init__(self): 821 super(ApiSummaryReader, self).__init__() 822 823 @staticmethod 824 def read_one(reader): 825 # Do nothing if there aren't more tags: 826 if not reader.forward(): 827 return None 828 829 # Create the object: 830 obj = types.ApiSummary() 831 832 # Process the attributes: 833 obj.href = reader.get_attribute('href') 834 835 # Discard the start tag: 836 empty = reader.empty_element() 837 reader.read() 838 if empty: 839 return obj 840 841 # Process the inner elements: 842 links = [] 843 while reader.forward(): 844 tag = reader.node_name() 845 if tag == 'hosts': 846 obj.hosts = ApiSummaryItemReader.read_one(reader) 847 elif tag == 'storage_domains': 848 obj.storage_domains = ApiSummaryItemReader.read_one(reader) 849 elif tag == 'users': 850 obj.users = ApiSummaryItemReader.read_one(reader) 851 elif tag == 'vms': 852 obj.vms = ApiSummaryItemReader.read_one(reader) 853 else: 854 reader.next_element() 855 for link in links: 856 ApiSummaryReader._process_link(link, obj) 857 858 # Discard the end tag: 859 reader.read() 860 861 return obj 862 863 @staticmethod 864 def read_many(reader): 865 # Do nothing if there aren't more tags: 866 objs = List() 867 if not reader.forward(): 868 return objs 869 870 # Process the attributes: 871 objs.href = reader.get_attribute('href') 872 873 # Discard the start tag: 874 empty = reader.empty_element() 875 reader.read() 876 if empty: 877 return objs 878 879 # Process the inner elements: 880 while reader.forward(): 881 objs.append(ApiSummaryReader.read_one(reader)) 882 883 # Discard the end tag: 884 reader.read() 885 886 return objs 887 888 889class ApiSummaryItemReader(Reader): 890 891 def __init__(self): 892 super(ApiSummaryItemReader, self).__init__() 893 894 @staticmethod 895 def read_one(reader): 896 # Do nothing if there aren't more tags: 897 if not reader.forward(): 898 return None 899 900 # Create the object: 901 obj = types.ApiSummaryItem() 902 903 # Process the attributes: 904 obj.href = reader.get_attribute('href') 905 906 # Discard the start tag: 907 empty = reader.empty_element() 908 reader.read() 909 if empty: 910 return obj 911 912 # Process the inner elements: 913 links = [] 914 while reader.forward(): 915 tag = reader.node_name() 916 if tag == 'active': 917 obj.active = Reader.read_integer(reader) 918 elif tag == 'total': 919 obj.total = Reader.read_integer(reader) 920 else: 921 reader.next_element() 922 for link in links: 923 ApiSummaryItemReader._process_link(link, obj) 924 925 # Discard the end tag: 926 reader.read() 927 928 return obj 929 930 @staticmethod 931 def read_many(reader): 932 # Do nothing if there aren't more tags: 933 objs = List() 934 if not reader.forward(): 935 return objs 936 937 # Process the attributes: 938 objs.href = reader.get_attribute('href') 939 940 # Discard the start tag: 941 empty = reader.empty_element() 942 reader.read() 943 if empty: 944 return objs 945 946 # Process the inner elements: 947 while reader.forward(): 948 objs.append(ApiSummaryItemReader.read_one(reader)) 949 950 # Discard the end tag: 951 reader.read() 952 953 return objs 954 955 956class ApplicationReader(Reader): 957 958 def __init__(self): 959 super(ApplicationReader, self).__init__() 960 961 @staticmethod 962 def read_one(reader): 963 # Do nothing if there aren't more tags: 964 if not reader.forward(): 965 return None 966 967 # Create the object: 968 obj = types.Application() 969 970 # Process the attributes: 971 obj.href = reader.get_attribute('href') 972 value = reader.get_attribute('id') 973 if value is not None: 974 obj.id = value 975 976 # Discard the start tag: 977 empty = reader.empty_element() 978 reader.read() 979 if empty: 980 return obj 981 982 # Process the inner elements: 983 links = [] 984 while reader.forward(): 985 tag = reader.node_name() 986 if tag == 'comment': 987 obj.comment = Reader.read_string(reader) 988 elif tag == 'description': 989 obj.description = Reader.read_string(reader) 990 elif tag == 'name': 991 obj.name = Reader.read_string(reader) 992 elif tag == 'vm': 993 obj.vm = VmReader.read_one(reader) 994 else: 995 reader.next_element() 996 for link in links: 997 ApplicationReader._process_link(link, obj) 998 999 # Discard the end tag: 1000 reader.read() 1001 1002 return obj 1003 1004 @staticmethod 1005 def read_many(reader): 1006 # Do nothing if there aren't more tags: 1007 objs = List() 1008 if not reader.forward(): 1009 return objs 1010 1011 # Process the attributes: 1012 objs.href = reader.get_attribute('href') 1013 1014 # Discard the start tag: 1015 empty = reader.empty_element() 1016 reader.read() 1017 if empty: 1018 return objs 1019 1020 # Process the inner elements: 1021 while reader.forward(): 1022 objs.append(ApplicationReader.read_one(reader)) 1023 1024 # Discard the end tag: 1025 reader.read() 1026 1027 return objs 1028 1029 1030class AuthorizedKeyReader(Reader): 1031 1032 def __init__(self): 1033 super(AuthorizedKeyReader, self).__init__() 1034 1035 @staticmethod 1036 def read_one(reader): 1037 # Do nothing if there aren't more tags: 1038 if not reader.forward(): 1039 return None 1040 1041 # Create the object: 1042 obj = types.AuthorizedKey() 1043 1044 # Process the attributes: 1045 obj.href = reader.get_attribute('href') 1046 value = reader.get_attribute('id') 1047 if value is not None: 1048 obj.id = value 1049 1050 # Discard the start tag: 1051 empty = reader.empty_element() 1052 reader.read() 1053 if empty: 1054 return obj 1055 1056 # Process the inner elements: 1057 links = [] 1058 while reader.forward(): 1059 tag = reader.node_name() 1060 if tag == 'comment': 1061 obj.comment = Reader.read_string(reader) 1062 elif tag == 'description': 1063 obj.description = Reader.read_string(reader) 1064 elif tag == 'key': 1065 obj.key = Reader.read_string(reader) 1066 elif tag == 'name': 1067 obj.name = Reader.read_string(reader) 1068 elif tag == 'user': 1069 obj.user = UserReader.read_one(reader) 1070 else: 1071 reader.next_element() 1072 for link in links: 1073 AuthorizedKeyReader._process_link(link, obj) 1074 1075 # Discard the end tag: 1076 reader.read() 1077 1078 return obj 1079 1080 @staticmethod 1081 def read_many(reader): 1082 # Do nothing if there aren't more tags: 1083 objs = List() 1084 if not reader.forward(): 1085 return objs 1086 1087 # Process the attributes: 1088 objs.href = reader.get_attribute('href') 1089 1090 # Discard the start tag: 1091 empty = reader.empty_element() 1092 reader.read() 1093 if empty: 1094 return objs 1095 1096 # Process the inner elements: 1097 while reader.forward(): 1098 objs.append(AuthorizedKeyReader.read_one(reader)) 1099 1100 # Discard the end tag: 1101 reader.read() 1102 1103 return objs 1104 1105 1106class BackupReader(Reader): 1107 1108 def __init__(self): 1109 super(BackupReader, self).__init__() 1110 1111 @staticmethod 1112 def read_one(reader): 1113 # Do nothing if there aren't more tags: 1114 if not reader.forward(): 1115 return None 1116 1117 # Create the object: 1118 obj = types.Backup() 1119 1120 # Process the attributes: 1121 obj.href = reader.get_attribute('href') 1122 value = reader.get_attribute('id') 1123 if value is not None: 1124 obj.id = value 1125 1126 # Discard the start tag: 1127 empty = reader.empty_element() 1128 reader.read() 1129 if empty: 1130 return obj 1131 1132 # Process the inner elements: 1133 links = [] 1134 while reader.forward(): 1135 tag = reader.node_name() 1136 if tag == 'comment': 1137 obj.comment = Reader.read_string(reader) 1138 elif tag == 'creation_date': 1139 obj.creation_date = Reader.read_date(reader) 1140 elif tag == 'description': 1141 obj.description = Reader.read_string(reader) 1142 elif tag == 'disks': 1143 obj.disks = DiskReader.read_many(reader) 1144 elif tag == 'from_checkpoint_id': 1145 obj.from_checkpoint_id = Reader.read_string(reader) 1146 elif tag == 'host': 1147 obj.host = HostReader.read_one(reader) 1148 elif tag == 'modification_date': 1149 obj.modification_date = Reader.read_date(reader) 1150 elif tag == 'name': 1151 obj.name = Reader.read_string(reader) 1152 elif tag == 'phase': 1153 obj.phase = Reader.read_enum(types.BackupPhase, reader) 1154 elif tag == 'snapshot': 1155 obj.snapshot = SnapshotReader.read_one(reader) 1156 elif tag == 'to_checkpoint_id': 1157 obj.to_checkpoint_id = Reader.read_string(reader) 1158 elif tag == 'vm': 1159 obj.vm = VmReader.read_one(reader) 1160 elif tag == 'link': 1161 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1162 reader.next_element() 1163 else: 1164 reader.next_element() 1165 for link in links: 1166 BackupReader._process_link(link, obj) 1167 1168 # Discard the end tag: 1169 reader.read() 1170 1171 return obj 1172 1173 @staticmethod 1174 def read_many(reader): 1175 # Do nothing if there aren't more tags: 1176 objs = List() 1177 if not reader.forward(): 1178 return objs 1179 1180 # Process the attributes: 1181 objs.href = reader.get_attribute('href') 1182 1183 # Discard the start tag: 1184 empty = reader.empty_element() 1185 reader.read() 1186 if empty: 1187 return objs 1188 1189 # Process the inner elements: 1190 while reader.forward(): 1191 objs.append(BackupReader.read_one(reader)) 1192 1193 # Discard the end tag: 1194 reader.read() 1195 1196 return objs 1197 1198 @staticmethod 1199 def _process_link(link, obj): 1200 # Process the attributes: 1201 rel = link[0] 1202 href = link[1] 1203 if href and rel: 1204 if rel == "disks": 1205 if obj.disks is not None: 1206 obj.disks.href = href 1207 else: 1208 obj.disks = List(href) 1209 1210 1211class BalanceReader(Reader): 1212 1213 def __init__(self): 1214 super(BalanceReader, self).__init__() 1215 1216 @staticmethod 1217 def read_one(reader): 1218 # Do nothing if there aren't more tags: 1219 if not reader.forward(): 1220 return None 1221 1222 # Create the object: 1223 obj = types.Balance() 1224 1225 # Process the attributes: 1226 obj.href = reader.get_attribute('href') 1227 value = reader.get_attribute('id') 1228 if value is not None: 1229 obj.id = value 1230 1231 # Discard the start tag: 1232 empty = reader.empty_element() 1233 reader.read() 1234 if empty: 1235 return obj 1236 1237 # Process the inner elements: 1238 links = [] 1239 while reader.forward(): 1240 tag = reader.node_name() 1241 if tag == 'comment': 1242 obj.comment = Reader.read_string(reader) 1243 elif tag == 'description': 1244 obj.description = Reader.read_string(reader) 1245 elif tag == 'name': 1246 obj.name = Reader.read_string(reader) 1247 elif tag == 'scheduling_policy': 1248 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 1249 elif tag == 'scheduling_policy_unit': 1250 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 1251 else: 1252 reader.next_element() 1253 for link in links: 1254 BalanceReader._process_link(link, obj) 1255 1256 # Discard the end tag: 1257 reader.read() 1258 1259 return obj 1260 1261 @staticmethod 1262 def read_many(reader): 1263 # Do nothing if there aren't more tags: 1264 objs = List() 1265 if not reader.forward(): 1266 return objs 1267 1268 # Process the attributes: 1269 objs.href = reader.get_attribute('href') 1270 1271 # Discard the start tag: 1272 empty = reader.empty_element() 1273 reader.read() 1274 if empty: 1275 return objs 1276 1277 # Process the inner elements: 1278 while reader.forward(): 1279 objs.append(BalanceReader.read_one(reader)) 1280 1281 # Discard the end tag: 1282 reader.read() 1283 1284 return objs 1285 1286 1287class BiosReader(Reader): 1288 1289 def __init__(self): 1290 super(BiosReader, self).__init__() 1291 1292 @staticmethod 1293 def read_one(reader): 1294 # Do nothing if there aren't more tags: 1295 if not reader.forward(): 1296 return None 1297 1298 # Create the object: 1299 obj = types.Bios() 1300 1301 # Process the attributes: 1302 obj.href = reader.get_attribute('href') 1303 1304 # Discard the start tag: 1305 empty = reader.empty_element() 1306 reader.read() 1307 if empty: 1308 return obj 1309 1310 # Process the inner elements: 1311 links = [] 1312 while reader.forward(): 1313 tag = reader.node_name() 1314 if tag == 'boot_menu': 1315 obj.boot_menu = BootMenuReader.read_one(reader) 1316 elif tag == 'type': 1317 obj.type = Reader.read_enum(types.BiosType, reader) 1318 else: 1319 reader.next_element() 1320 for link in links: 1321 BiosReader._process_link(link, obj) 1322 1323 # Discard the end tag: 1324 reader.read() 1325 1326 return obj 1327 1328 @staticmethod 1329 def read_many(reader): 1330 # Do nothing if there aren't more tags: 1331 objs = List() 1332 if not reader.forward(): 1333 return objs 1334 1335 # Process the attributes: 1336 objs.href = reader.get_attribute('href') 1337 1338 # Discard the start tag: 1339 empty = reader.empty_element() 1340 reader.read() 1341 if empty: 1342 return objs 1343 1344 # Process the inner elements: 1345 while reader.forward(): 1346 objs.append(BiosReader.read_one(reader)) 1347 1348 # Discard the end tag: 1349 reader.read() 1350 1351 return objs 1352 1353 1354class BlockStatisticReader(Reader): 1355 1356 def __init__(self): 1357 super(BlockStatisticReader, self).__init__() 1358 1359 @staticmethod 1360 def read_one(reader): 1361 # Do nothing if there aren't more tags: 1362 if not reader.forward(): 1363 return None 1364 1365 # Create the object: 1366 obj = types.BlockStatistic() 1367 1368 # Process the attributes: 1369 obj.href = reader.get_attribute('href') 1370 1371 # Discard the start tag: 1372 empty = reader.empty_element() 1373 reader.read() 1374 if empty: 1375 return obj 1376 1377 # Process the inner elements: 1378 links = [] 1379 while reader.forward(): 1380 tag = reader.node_name() 1381 if tag == 'statistics': 1382 obj.statistics = StatisticReader.read_many(reader) 1383 else: 1384 reader.next_element() 1385 for link in links: 1386 BlockStatisticReader._process_link(link, obj) 1387 1388 # Discard the end tag: 1389 reader.read() 1390 1391 return obj 1392 1393 @staticmethod 1394 def read_many(reader): 1395 # Do nothing if there aren't more tags: 1396 objs = List() 1397 if not reader.forward(): 1398 return objs 1399 1400 # Process the attributes: 1401 objs.href = reader.get_attribute('href') 1402 1403 # Discard the start tag: 1404 empty = reader.empty_element() 1405 reader.read() 1406 if empty: 1407 return objs 1408 1409 # Process the inner elements: 1410 while reader.forward(): 1411 objs.append(BlockStatisticReader.read_one(reader)) 1412 1413 # Discard the end tag: 1414 reader.read() 1415 1416 return objs 1417 1418 1419class BondingReader(Reader): 1420 1421 def __init__(self): 1422 super(BondingReader, self).__init__() 1423 1424 @staticmethod 1425 def read_one(reader): 1426 # Do nothing if there aren't more tags: 1427 if not reader.forward(): 1428 return None 1429 1430 # Create the object: 1431 obj = types.Bonding() 1432 1433 # Process the attributes: 1434 obj.href = reader.get_attribute('href') 1435 1436 # Discard the start tag: 1437 empty = reader.empty_element() 1438 reader.read() 1439 if empty: 1440 return obj 1441 1442 # Process the inner elements: 1443 links = [] 1444 while reader.forward(): 1445 tag = reader.node_name() 1446 if tag == 'active_slave': 1447 obj.active_slave = HostNicReader.read_one(reader) 1448 elif tag == 'ad_partner_mac': 1449 obj.ad_partner_mac = MacReader.read_one(reader) 1450 elif tag == 'options': 1451 obj.options = OptionReader.read_many(reader) 1452 elif tag == 'slaves': 1453 obj.slaves = HostNicReader.read_many(reader) 1454 else: 1455 reader.next_element() 1456 for link in links: 1457 BondingReader._process_link(link, obj) 1458 1459 # Discard the end tag: 1460 reader.read() 1461 1462 return obj 1463 1464 @staticmethod 1465 def read_many(reader): 1466 # Do nothing if there aren't more tags: 1467 objs = List() 1468 if not reader.forward(): 1469 return objs 1470 1471 # Process the attributes: 1472 objs.href = reader.get_attribute('href') 1473 1474 # Discard the start tag: 1475 empty = reader.empty_element() 1476 reader.read() 1477 if empty: 1478 return objs 1479 1480 # Process the inner elements: 1481 while reader.forward(): 1482 objs.append(BondingReader.read_one(reader)) 1483 1484 # Discard the end tag: 1485 reader.read() 1486 1487 return objs 1488 1489 1490class BookmarkReader(Reader): 1491 1492 def __init__(self): 1493 super(BookmarkReader, self).__init__() 1494 1495 @staticmethod 1496 def read_one(reader): 1497 # Do nothing if there aren't more tags: 1498 if not reader.forward(): 1499 return None 1500 1501 # Create the object: 1502 obj = types.Bookmark() 1503 1504 # Process the attributes: 1505 obj.href = reader.get_attribute('href') 1506 value = reader.get_attribute('id') 1507 if value is not None: 1508 obj.id = value 1509 1510 # Discard the start tag: 1511 empty = reader.empty_element() 1512 reader.read() 1513 if empty: 1514 return obj 1515 1516 # Process the inner elements: 1517 links = [] 1518 while reader.forward(): 1519 tag = reader.node_name() 1520 if tag == 'comment': 1521 obj.comment = Reader.read_string(reader) 1522 elif tag == 'description': 1523 obj.description = Reader.read_string(reader) 1524 elif tag == 'name': 1525 obj.name = Reader.read_string(reader) 1526 elif tag == 'value': 1527 obj.value = Reader.read_string(reader) 1528 else: 1529 reader.next_element() 1530 for link in links: 1531 BookmarkReader._process_link(link, obj) 1532 1533 # Discard the end tag: 1534 reader.read() 1535 1536 return obj 1537 1538 @staticmethod 1539 def read_many(reader): 1540 # Do nothing if there aren't more tags: 1541 objs = List() 1542 if not reader.forward(): 1543 return objs 1544 1545 # Process the attributes: 1546 objs.href = reader.get_attribute('href') 1547 1548 # Discard the start tag: 1549 empty = reader.empty_element() 1550 reader.read() 1551 if empty: 1552 return objs 1553 1554 # Process the inner elements: 1555 while reader.forward(): 1556 objs.append(BookmarkReader.read_one(reader)) 1557 1558 # Discard the end tag: 1559 reader.read() 1560 1561 return objs 1562 1563 1564class BootReader(Reader): 1565 1566 def __init__(self): 1567 super(BootReader, self).__init__() 1568 1569 @staticmethod 1570 def read_one(reader): 1571 # Do nothing if there aren't more tags: 1572 if not reader.forward(): 1573 return None 1574 1575 # Create the object: 1576 obj = types.Boot() 1577 1578 # Process the attributes: 1579 obj.href = reader.get_attribute('href') 1580 1581 # Discard the start tag: 1582 empty = reader.empty_element() 1583 reader.read() 1584 if empty: 1585 return obj 1586 1587 # Process the inner elements: 1588 links = [] 1589 while reader.forward(): 1590 tag = reader.node_name() 1591 if tag == 'devices': 1592 obj.devices = Reader.read_enums(types.BootDevice, reader) 1593 else: 1594 reader.next_element() 1595 for link in links: 1596 BootReader._process_link(link, obj) 1597 1598 # Discard the end tag: 1599 reader.read() 1600 1601 return obj 1602 1603 @staticmethod 1604 def read_many(reader): 1605 # Do nothing if there aren't more tags: 1606 objs = List() 1607 if not reader.forward(): 1608 return objs 1609 1610 # Process the attributes: 1611 objs.href = reader.get_attribute('href') 1612 1613 # Discard the start tag: 1614 empty = reader.empty_element() 1615 reader.read() 1616 if empty: 1617 return objs 1618 1619 # Process the inner elements: 1620 while reader.forward(): 1621 objs.append(BootReader.read_one(reader)) 1622 1623 # Discard the end tag: 1624 reader.read() 1625 1626 return objs 1627 1628 1629class BootMenuReader(Reader): 1630 1631 def __init__(self): 1632 super(BootMenuReader, self).__init__() 1633 1634 @staticmethod 1635 def read_one(reader): 1636 # Do nothing if there aren't more tags: 1637 if not reader.forward(): 1638 return None 1639 1640 # Create the object: 1641 obj = types.BootMenu() 1642 1643 # Process the attributes: 1644 obj.href = reader.get_attribute('href') 1645 1646 # Discard the start tag: 1647 empty = reader.empty_element() 1648 reader.read() 1649 if empty: 1650 return obj 1651 1652 # Process the inner elements: 1653 links = [] 1654 while reader.forward(): 1655 tag = reader.node_name() 1656 if tag == 'enabled': 1657 obj.enabled = Reader.read_boolean(reader) 1658 else: 1659 reader.next_element() 1660 for link in links: 1661 BootMenuReader._process_link(link, obj) 1662 1663 # Discard the end tag: 1664 reader.read() 1665 1666 return obj 1667 1668 @staticmethod 1669 def read_many(reader): 1670 # Do nothing if there aren't more tags: 1671 objs = List() 1672 if not reader.forward(): 1673 return objs 1674 1675 # Process the attributes: 1676 objs.href = reader.get_attribute('href') 1677 1678 # Discard the start tag: 1679 empty = reader.empty_element() 1680 reader.read() 1681 if empty: 1682 return objs 1683 1684 # Process the inner elements: 1685 while reader.forward(): 1686 objs.append(BootMenuReader.read_one(reader)) 1687 1688 # Discard the end tag: 1689 reader.read() 1690 1691 return objs 1692 1693 1694class BrickProfileDetailReader(Reader): 1695 1696 def __init__(self): 1697 super(BrickProfileDetailReader, self).__init__() 1698 1699 @staticmethod 1700 def read_one(reader): 1701 # Do nothing if there aren't more tags: 1702 if not reader.forward(): 1703 return None 1704 1705 # Create the object: 1706 obj = types.BrickProfileDetail() 1707 1708 # Process the attributes: 1709 obj.href = reader.get_attribute('href') 1710 1711 # Discard the start tag: 1712 empty = reader.empty_element() 1713 reader.read() 1714 if empty: 1715 return obj 1716 1717 # Process the inner elements: 1718 links = [] 1719 while reader.forward(): 1720 tag = reader.node_name() 1721 if tag == 'brick': 1722 obj.brick = GlusterBrickReader.read_one(reader) 1723 elif tag == 'profile_details': 1724 obj.profile_details = ProfileDetailReader.read_many(reader) 1725 else: 1726 reader.next_element() 1727 for link in links: 1728 BrickProfileDetailReader._process_link(link, obj) 1729 1730 # Discard the end tag: 1731 reader.read() 1732 1733 return obj 1734 1735 @staticmethod 1736 def read_many(reader): 1737 # Do nothing if there aren't more tags: 1738 objs = List() 1739 if not reader.forward(): 1740 return objs 1741 1742 # Process the attributes: 1743 objs.href = reader.get_attribute('href') 1744 1745 # Discard the start tag: 1746 empty = reader.empty_element() 1747 reader.read() 1748 if empty: 1749 return objs 1750 1751 # Process the inner elements: 1752 while reader.forward(): 1753 objs.append(BrickProfileDetailReader.read_one(reader)) 1754 1755 # Discard the end tag: 1756 reader.read() 1757 1758 return objs 1759 1760 1761class CdromReader(Reader): 1762 1763 def __init__(self): 1764 super(CdromReader, self).__init__() 1765 1766 @staticmethod 1767 def read_one(reader): 1768 # Do nothing if there aren't more tags: 1769 if not reader.forward(): 1770 return None 1771 1772 # Create the object: 1773 obj = types.Cdrom() 1774 1775 # Process the attributes: 1776 obj.href = reader.get_attribute('href') 1777 value = reader.get_attribute('id') 1778 if value is not None: 1779 obj.id = value 1780 1781 # Discard the start tag: 1782 empty = reader.empty_element() 1783 reader.read() 1784 if empty: 1785 return obj 1786 1787 # Process the inner elements: 1788 links = [] 1789 while reader.forward(): 1790 tag = reader.node_name() 1791 if tag == 'comment': 1792 obj.comment = Reader.read_string(reader) 1793 elif tag == 'description': 1794 obj.description = Reader.read_string(reader) 1795 elif tag == 'file': 1796 obj.file = FileReader.read_one(reader) 1797 elif tag == 'instance_type': 1798 obj.instance_type = InstanceTypeReader.read_one(reader) 1799 elif tag == 'name': 1800 obj.name = Reader.read_string(reader) 1801 elif tag == 'template': 1802 obj.template = TemplateReader.read_one(reader) 1803 elif tag == 'vm': 1804 obj.vm = VmReader.read_one(reader) 1805 elif tag == 'vms': 1806 obj.vms = VmReader.read_many(reader) 1807 elif tag == 'link': 1808 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1809 reader.next_element() 1810 else: 1811 reader.next_element() 1812 for link in links: 1813 CdromReader._process_link(link, obj) 1814 1815 # Discard the end tag: 1816 reader.read() 1817 1818 return obj 1819 1820 @staticmethod 1821 def read_many(reader): 1822 # Do nothing if there aren't more tags: 1823 objs = List() 1824 if not reader.forward(): 1825 return objs 1826 1827 # Process the attributes: 1828 objs.href = reader.get_attribute('href') 1829 1830 # Discard the start tag: 1831 empty = reader.empty_element() 1832 reader.read() 1833 if empty: 1834 return objs 1835 1836 # Process the inner elements: 1837 while reader.forward(): 1838 objs.append(CdromReader.read_one(reader)) 1839 1840 # Discard the end tag: 1841 reader.read() 1842 1843 return objs 1844 1845 @staticmethod 1846 def _process_link(link, obj): 1847 # Process the attributes: 1848 rel = link[0] 1849 href = link[1] 1850 if href and rel: 1851 if rel == "vms": 1852 if obj.vms is not None: 1853 obj.vms.href = href 1854 else: 1855 obj.vms = List(href) 1856 1857 1858class CertificateReader(Reader): 1859 1860 def __init__(self): 1861 super(CertificateReader, self).__init__() 1862 1863 @staticmethod 1864 def read_one(reader): 1865 # Do nothing if there aren't more tags: 1866 if not reader.forward(): 1867 return None 1868 1869 # Create the object: 1870 obj = types.Certificate() 1871 1872 # Process the attributes: 1873 obj.href = reader.get_attribute('href') 1874 value = reader.get_attribute('id') 1875 if value is not None: 1876 obj.id = value 1877 1878 # Discard the start tag: 1879 empty = reader.empty_element() 1880 reader.read() 1881 if empty: 1882 return obj 1883 1884 # Process the inner elements: 1885 links = [] 1886 while reader.forward(): 1887 tag = reader.node_name() 1888 if tag == 'comment': 1889 obj.comment = Reader.read_string(reader) 1890 elif tag == 'content': 1891 obj.content = Reader.read_string(reader) 1892 elif tag == 'description': 1893 obj.description = Reader.read_string(reader) 1894 elif tag == 'name': 1895 obj.name = Reader.read_string(reader) 1896 elif tag == 'organization': 1897 obj.organization = Reader.read_string(reader) 1898 elif tag == 'subject': 1899 obj.subject = Reader.read_string(reader) 1900 else: 1901 reader.next_element() 1902 for link in links: 1903 CertificateReader._process_link(link, obj) 1904 1905 # Discard the end tag: 1906 reader.read() 1907 1908 return obj 1909 1910 @staticmethod 1911 def read_many(reader): 1912 # Do nothing if there aren't more tags: 1913 objs = List() 1914 if not reader.forward(): 1915 return objs 1916 1917 # Process the attributes: 1918 objs.href = reader.get_attribute('href') 1919 1920 # Discard the start tag: 1921 empty = reader.empty_element() 1922 reader.read() 1923 if empty: 1924 return objs 1925 1926 # Process the inner elements: 1927 while reader.forward(): 1928 objs.append(CertificateReader.read_one(reader)) 1929 1930 # Discard the end tag: 1931 reader.read() 1932 1933 return objs 1934 1935 1936class CheckpointReader(Reader): 1937 1938 def __init__(self): 1939 super(CheckpointReader, self).__init__() 1940 1941 @staticmethod 1942 def read_one(reader): 1943 # Do nothing if there aren't more tags: 1944 if not reader.forward(): 1945 return None 1946 1947 # Create the object: 1948 obj = types.Checkpoint() 1949 1950 # Process the attributes: 1951 obj.href = reader.get_attribute('href') 1952 value = reader.get_attribute('id') 1953 if value is not None: 1954 obj.id = value 1955 1956 # Discard the start tag: 1957 empty = reader.empty_element() 1958 reader.read() 1959 if empty: 1960 return obj 1961 1962 # Process the inner elements: 1963 links = [] 1964 while reader.forward(): 1965 tag = reader.node_name() 1966 if tag == 'comment': 1967 obj.comment = Reader.read_string(reader) 1968 elif tag == 'creation_date': 1969 obj.creation_date = Reader.read_date(reader) 1970 elif tag == 'description': 1971 obj.description = Reader.read_string(reader) 1972 elif tag == 'disks': 1973 obj.disks = DiskReader.read_many(reader) 1974 elif tag == 'name': 1975 obj.name = Reader.read_string(reader) 1976 elif tag == 'parent_id': 1977 obj.parent_id = Reader.read_string(reader) 1978 elif tag == 'state': 1979 obj.state = Reader.read_enum(types.CheckpointState, reader) 1980 elif tag == 'vm': 1981 obj.vm = VmReader.read_one(reader) 1982 elif tag == 'link': 1983 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1984 reader.next_element() 1985 else: 1986 reader.next_element() 1987 for link in links: 1988 CheckpointReader._process_link(link, obj) 1989 1990 # Discard the end tag: 1991 reader.read() 1992 1993 return obj 1994 1995 @staticmethod 1996 def read_many(reader): 1997 # Do nothing if there aren't more tags: 1998 objs = List() 1999 if not reader.forward(): 2000 return objs 2001 2002 # Process the attributes: 2003 objs.href = reader.get_attribute('href') 2004 2005 # Discard the start tag: 2006 empty = reader.empty_element() 2007 reader.read() 2008 if empty: 2009 return objs 2010 2011 # Process the inner elements: 2012 while reader.forward(): 2013 objs.append(CheckpointReader.read_one(reader)) 2014 2015 # Discard the end tag: 2016 reader.read() 2017 2018 return objs 2019 2020 @staticmethod 2021 def _process_link(link, obj): 2022 # Process the attributes: 2023 rel = link[0] 2024 href = link[1] 2025 if href and rel: 2026 if rel == "disks": 2027 if obj.disks is not None: 2028 obj.disks.href = href 2029 else: 2030 obj.disks = List(href) 2031 2032 2033class CloudInitReader(Reader): 2034 2035 def __init__(self): 2036 super(CloudInitReader, self).__init__() 2037 2038 @staticmethod 2039 def read_one(reader): 2040 # Do nothing if there aren't more tags: 2041 if not reader.forward(): 2042 return None 2043 2044 # Create the object: 2045 obj = types.CloudInit() 2046 2047 # Process the attributes: 2048 obj.href = reader.get_attribute('href') 2049 2050 # Discard the start tag: 2051 empty = reader.empty_element() 2052 reader.read() 2053 if empty: 2054 return obj 2055 2056 # Process the inner elements: 2057 links = [] 2058 while reader.forward(): 2059 tag = reader.node_name() 2060 if tag == 'authorized_keys': 2061 obj.authorized_keys = AuthorizedKeyReader.read_many(reader) 2062 elif tag == 'files': 2063 obj.files = FileReader.read_many(reader) 2064 elif tag == 'host': 2065 obj.host = HostReader.read_one(reader) 2066 elif tag == 'network_configuration': 2067 obj.network_configuration = NetworkConfigurationReader.read_one(reader) 2068 elif tag == 'regenerate_ssh_keys': 2069 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 2070 elif tag == 'timezone': 2071 obj.timezone = Reader.read_string(reader) 2072 elif tag == 'users': 2073 obj.users = UserReader.read_many(reader) 2074 else: 2075 reader.next_element() 2076 for link in links: 2077 CloudInitReader._process_link(link, obj) 2078 2079 # Discard the end tag: 2080 reader.read() 2081 2082 return obj 2083 2084 @staticmethod 2085 def read_many(reader): 2086 # Do nothing if there aren't more tags: 2087 objs = List() 2088 if not reader.forward(): 2089 return objs 2090 2091 # Process the attributes: 2092 objs.href = reader.get_attribute('href') 2093 2094 # Discard the start tag: 2095 empty = reader.empty_element() 2096 reader.read() 2097 if empty: 2098 return objs 2099 2100 # Process the inner elements: 2101 while reader.forward(): 2102 objs.append(CloudInitReader.read_one(reader)) 2103 2104 # Discard the end tag: 2105 reader.read() 2106 2107 return objs 2108 2109 2110class ClusterReader(Reader): 2111 2112 def __init__(self): 2113 super(ClusterReader, self).__init__() 2114 2115 @staticmethod 2116 def read_one(reader): 2117 # Do nothing if there aren't more tags: 2118 if not reader.forward(): 2119 return None 2120 2121 # Create the object: 2122 obj = types.Cluster() 2123 2124 # Process the attributes: 2125 obj.href = reader.get_attribute('href') 2126 value = reader.get_attribute('id') 2127 if value is not None: 2128 obj.id = value 2129 2130 # Discard the start tag: 2131 empty = reader.empty_element() 2132 reader.read() 2133 if empty: 2134 return obj 2135 2136 # Process the inner elements: 2137 links = [] 2138 while reader.forward(): 2139 tag = reader.node_name() 2140 if tag == 'affinity_groups': 2141 obj.affinity_groups = AffinityGroupReader.read_many(reader) 2142 elif tag == 'ballooning_enabled': 2143 obj.ballooning_enabled = Reader.read_boolean(reader) 2144 elif tag == 'bios_type': 2145 obj.bios_type = Reader.read_enum(types.BiosType, reader) 2146 elif tag == 'comment': 2147 obj.comment = Reader.read_string(reader) 2148 elif tag == 'cpu': 2149 obj.cpu = CpuReader.read_one(reader) 2150 elif tag == 'cpu_profiles': 2151 obj.cpu_profiles = CpuProfileReader.read_many(reader) 2152 elif tag == 'custom_scheduling_policy_properties': 2153 obj.custom_scheduling_policy_properties = PropertyReader.read_many(reader) 2154 elif tag == 'data_center': 2155 obj.data_center = DataCenterReader.read_one(reader) 2156 elif tag == 'description': 2157 obj.description = Reader.read_string(reader) 2158 elif tag == 'display': 2159 obj.display = DisplayReader.read_one(reader) 2160 elif tag == 'enabled_features': 2161 obj.enabled_features = ClusterFeatureReader.read_many(reader) 2162 elif tag == 'error_handling': 2163 obj.error_handling = ErrorHandlingReader.read_one(reader) 2164 elif tag == 'external_network_providers': 2165 obj.external_network_providers = ExternalProviderReader.read_many(reader) 2166 elif tag == 'fencing_policy': 2167 obj.fencing_policy = FencingPolicyReader.read_one(reader) 2168 elif tag == 'fips_mode': 2169 obj.fips_mode = Reader.read_enum(types.FipsMode, reader) 2170 elif tag == 'firewall_type': 2171 obj.firewall_type = Reader.read_enum(types.FirewallType, reader) 2172 elif tag == 'gluster_hooks': 2173 obj.gluster_hooks = GlusterHookReader.read_many(reader) 2174 elif tag == 'gluster_service': 2175 obj.gluster_service = Reader.read_boolean(reader) 2176 elif tag == 'gluster_tuned_profile': 2177 obj.gluster_tuned_profile = Reader.read_string(reader) 2178 elif tag == 'gluster_volumes': 2179 obj.gluster_volumes = GlusterVolumeReader.read_many(reader) 2180 elif tag == 'ha_reservation': 2181 obj.ha_reservation = Reader.read_boolean(reader) 2182 elif tag == 'ksm': 2183 obj.ksm = KsmReader.read_one(reader) 2184 elif tag == 'log_max_memory_used_threshold': 2185 obj.log_max_memory_used_threshold = Reader.read_integer(reader) 2186 elif tag == 'log_max_memory_used_threshold_type': 2187 obj.log_max_memory_used_threshold_type = Reader.read_enum(types.LogMaxMemoryUsedThresholdType, reader) 2188 elif tag == 'mac_pool': 2189 obj.mac_pool = MacPoolReader.read_one(reader) 2190 elif tag == 'maintenance_reason_required': 2191 obj.maintenance_reason_required = Reader.read_boolean(reader) 2192 elif tag == 'management_network': 2193 obj.management_network = NetworkReader.read_one(reader) 2194 elif tag == 'memory_policy': 2195 obj.memory_policy = MemoryPolicyReader.read_one(reader) 2196 elif tag == 'migration': 2197 obj.migration = MigrationOptionsReader.read_one(reader) 2198 elif tag == 'name': 2199 obj.name = Reader.read_string(reader) 2200 elif tag == 'network_filters': 2201 obj.network_filters = NetworkFilterReader.read_many(reader) 2202 elif tag == 'networks': 2203 obj.networks = NetworkReader.read_many(reader) 2204 elif tag == 'optional_reason': 2205 obj.optional_reason = Reader.read_boolean(reader) 2206 elif tag == 'permissions': 2207 obj.permissions = PermissionReader.read_many(reader) 2208 elif tag == 'required_rng_sources': 2209 obj.required_rng_sources = Reader.read_enums(types.RngSource, reader) 2210 elif tag == 'scheduling_policy': 2211 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 2212 elif tag == 'serial_number': 2213 obj.serial_number = SerialNumberReader.read_one(reader) 2214 elif tag == 'supported_versions': 2215 obj.supported_versions = VersionReader.read_many(reader) 2216 elif tag == 'switch_type': 2217 obj.switch_type = Reader.read_enum(types.SwitchType, reader) 2218 elif tag == 'threads_as_cores': 2219 obj.threads_as_cores = Reader.read_boolean(reader) 2220 elif tag == 'trusted_service': 2221 obj.trusted_service = Reader.read_boolean(reader) 2222 elif tag == 'tunnel_migration': 2223 obj.tunnel_migration = Reader.read_boolean(reader) 2224 elif tag == 'upgrade_correlation_id': 2225 obj.upgrade_correlation_id = Reader.read_string(reader) 2226 elif tag == 'upgrade_in_progress': 2227 obj.upgrade_in_progress = Reader.read_boolean(reader) 2228 elif tag == 'upgrade_percent_complete': 2229 obj.upgrade_percent_complete = Reader.read_integer(reader) 2230 elif tag == 'version': 2231 obj.version = VersionReader.read_one(reader) 2232 elif tag == 'virt_service': 2233 obj.virt_service = Reader.read_boolean(reader) 2234 elif tag == 'vnc_encryption': 2235 obj.vnc_encryption = Reader.read_boolean(reader) 2236 elif tag == 'link': 2237 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2238 reader.next_element() 2239 else: 2240 reader.next_element() 2241 for link in links: 2242 ClusterReader._process_link(link, obj) 2243 2244 # Discard the end tag: 2245 reader.read() 2246 2247 return obj 2248 2249 @staticmethod 2250 def read_many(reader): 2251 # Do nothing if there aren't more tags: 2252 objs = List() 2253 if not reader.forward(): 2254 return objs 2255 2256 # Process the attributes: 2257 objs.href = reader.get_attribute('href') 2258 2259 # Discard the start tag: 2260 empty = reader.empty_element() 2261 reader.read() 2262 if empty: 2263 return objs 2264 2265 # Process the inner elements: 2266 while reader.forward(): 2267 objs.append(ClusterReader.read_one(reader)) 2268 2269 # Discard the end tag: 2270 reader.read() 2271 2272 return objs 2273 2274 @staticmethod 2275 def _process_link(link, obj): 2276 # Process the attributes: 2277 rel = link[0] 2278 href = link[1] 2279 if href and rel: 2280 if rel == "affinitygroups": 2281 if obj.affinity_groups is not None: 2282 obj.affinity_groups.href = href 2283 else: 2284 obj.affinity_groups = List(href) 2285 elif rel == "cpuprofiles": 2286 if obj.cpu_profiles is not None: 2287 obj.cpu_profiles.href = href 2288 else: 2289 obj.cpu_profiles = List(href) 2290 elif rel == "enabledfeatures": 2291 if obj.enabled_features is not None: 2292 obj.enabled_features.href = href 2293 else: 2294 obj.enabled_features = List(href) 2295 elif rel == "externalnetworkproviders": 2296 if obj.external_network_providers is not None: 2297 obj.external_network_providers.href = href 2298 else: 2299 obj.external_network_providers = List(href) 2300 elif rel == "glusterhooks": 2301 if obj.gluster_hooks is not None: 2302 obj.gluster_hooks.href = href 2303 else: 2304 obj.gluster_hooks = List(href) 2305 elif rel == "glustervolumes": 2306 if obj.gluster_volumes is not None: 2307 obj.gluster_volumes.href = href 2308 else: 2309 obj.gluster_volumes = List(href) 2310 elif rel == "networkfilters": 2311 if obj.network_filters is not None: 2312 obj.network_filters.href = href 2313 else: 2314 obj.network_filters = List(href) 2315 elif rel == "networks": 2316 if obj.networks is not None: 2317 obj.networks.href = href 2318 else: 2319 obj.networks = List(href) 2320 elif rel == "permissions": 2321 if obj.permissions is not None: 2322 obj.permissions.href = href 2323 else: 2324 obj.permissions = List(href) 2325 2326 2327class ClusterFeatureReader(Reader): 2328 2329 def __init__(self): 2330 super(ClusterFeatureReader, self).__init__() 2331 2332 @staticmethod 2333 def read_one(reader): 2334 # Do nothing if there aren't more tags: 2335 if not reader.forward(): 2336 return None 2337 2338 # Create the object: 2339 obj = types.ClusterFeature() 2340 2341 # Process the attributes: 2342 obj.href = reader.get_attribute('href') 2343 value = reader.get_attribute('id') 2344 if value is not None: 2345 obj.id = value 2346 2347 # Discard the start tag: 2348 empty = reader.empty_element() 2349 reader.read() 2350 if empty: 2351 return obj 2352 2353 # Process the inner elements: 2354 links = [] 2355 while reader.forward(): 2356 tag = reader.node_name() 2357 if tag == 'cluster_level': 2358 obj.cluster_level = ClusterLevelReader.read_one(reader) 2359 elif tag == 'comment': 2360 obj.comment = Reader.read_string(reader) 2361 elif tag == 'description': 2362 obj.description = Reader.read_string(reader) 2363 elif tag == 'name': 2364 obj.name = Reader.read_string(reader) 2365 else: 2366 reader.next_element() 2367 for link in links: 2368 ClusterFeatureReader._process_link(link, obj) 2369 2370 # Discard the end tag: 2371 reader.read() 2372 2373 return obj 2374 2375 @staticmethod 2376 def read_many(reader): 2377 # Do nothing if there aren't more tags: 2378 objs = List() 2379 if not reader.forward(): 2380 return objs 2381 2382 # Process the attributes: 2383 objs.href = reader.get_attribute('href') 2384 2385 # Discard the start tag: 2386 empty = reader.empty_element() 2387 reader.read() 2388 if empty: 2389 return objs 2390 2391 # Process the inner elements: 2392 while reader.forward(): 2393 objs.append(ClusterFeatureReader.read_one(reader)) 2394 2395 # Discard the end tag: 2396 reader.read() 2397 2398 return objs 2399 2400 2401class ClusterLevelReader(Reader): 2402 2403 def __init__(self): 2404 super(ClusterLevelReader, self).__init__() 2405 2406 @staticmethod 2407 def read_one(reader): 2408 # Do nothing if there aren't more tags: 2409 if not reader.forward(): 2410 return None 2411 2412 # Create the object: 2413 obj = types.ClusterLevel() 2414 2415 # Process the attributes: 2416 obj.href = reader.get_attribute('href') 2417 value = reader.get_attribute('id') 2418 if value is not None: 2419 obj.id = value 2420 2421 # Discard the start tag: 2422 empty = reader.empty_element() 2423 reader.read() 2424 if empty: 2425 return obj 2426 2427 # Process the inner elements: 2428 links = [] 2429 while reader.forward(): 2430 tag = reader.node_name() 2431 if tag == 'cluster_features': 2432 obj.cluster_features = ClusterFeatureReader.read_many(reader) 2433 elif tag == 'comment': 2434 obj.comment = Reader.read_string(reader) 2435 elif tag == 'cpu_types': 2436 obj.cpu_types = CpuTypeReader.read_many(reader) 2437 elif tag == 'description': 2438 obj.description = Reader.read_string(reader) 2439 elif tag == 'name': 2440 obj.name = Reader.read_string(reader) 2441 elif tag == 'permits': 2442 obj.permits = PermitReader.read_many(reader) 2443 elif tag == 'link': 2444 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2445 reader.next_element() 2446 else: 2447 reader.next_element() 2448 for link in links: 2449 ClusterLevelReader._process_link(link, obj) 2450 2451 # Discard the end tag: 2452 reader.read() 2453 2454 return obj 2455 2456 @staticmethod 2457 def read_many(reader): 2458 # Do nothing if there aren't more tags: 2459 objs = List() 2460 if not reader.forward(): 2461 return objs 2462 2463 # Process the attributes: 2464 objs.href = reader.get_attribute('href') 2465 2466 # Discard the start tag: 2467 empty = reader.empty_element() 2468 reader.read() 2469 if empty: 2470 return objs 2471 2472 # Process the inner elements: 2473 while reader.forward(): 2474 objs.append(ClusterLevelReader.read_one(reader)) 2475 2476 # Discard the end tag: 2477 reader.read() 2478 2479 return objs 2480 2481 @staticmethod 2482 def _process_link(link, obj): 2483 # Process the attributes: 2484 rel = link[0] 2485 href = link[1] 2486 if href and rel: 2487 if rel == "clusterfeatures": 2488 if obj.cluster_features is not None: 2489 obj.cluster_features.href = href 2490 else: 2491 obj.cluster_features = List(href) 2492 2493 2494class ConfigurationReader(Reader): 2495 2496 def __init__(self): 2497 super(ConfigurationReader, self).__init__() 2498 2499 @staticmethod 2500 def read_one(reader): 2501 # Do nothing if there aren't more tags: 2502 if not reader.forward(): 2503 return None 2504 2505 # Create the object: 2506 obj = types.Configuration() 2507 2508 # Process the attributes: 2509 obj.href = reader.get_attribute('href') 2510 2511 # Discard the start tag: 2512 empty = reader.empty_element() 2513 reader.read() 2514 if empty: 2515 return obj 2516 2517 # Process the inner elements: 2518 links = [] 2519 while reader.forward(): 2520 tag = reader.node_name() 2521 if tag == 'data': 2522 obj.data = Reader.read_string(reader) 2523 elif tag == 'type': 2524 obj.type = Reader.read_enum(types.ConfigurationType, reader) 2525 else: 2526 reader.next_element() 2527 for link in links: 2528 ConfigurationReader._process_link(link, obj) 2529 2530 # Discard the end tag: 2531 reader.read() 2532 2533 return obj 2534 2535 @staticmethod 2536 def read_many(reader): 2537 # Do nothing if there aren't more tags: 2538 objs = List() 2539 if not reader.forward(): 2540 return objs 2541 2542 # Process the attributes: 2543 objs.href = reader.get_attribute('href') 2544 2545 # Discard the start tag: 2546 empty = reader.empty_element() 2547 reader.read() 2548 if empty: 2549 return objs 2550 2551 # Process the inner elements: 2552 while reader.forward(): 2553 objs.append(ConfigurationReader.read_one(reader)) 2554 2555 # Discard the end tag: 2556 reader.read() 2557 2558 return objs 2559 2560 2561class ConsoleReader(Reader): 2562 2563 def __init__(self): 2564 super(ConsoleReader, self).__init__() 2565 2566 @staticmethod 2567 def read_one(reader): 2568 # Do nothing if there aren't more tags: 2569 if not reader.forward(): 2570 return None 2571 2572 # Create the object: 2573 obj = types.Console() 2574 2575 # Process the attributes: 2576 obj.href = reader.get_attribute('href') 2577 2578 # Discard the start tag: 2579 empty = reader.empty_element() 2580 reader.read() 2581 if empty: 2582 return obj 2583 2584 # Process the inner elements: 2585 links = [] 2586 while reader.forward(): 2587 tag = reader.node_name() 2588 if tag == 'enabled': 2589 obj.enabled = Reader.read_boolean(reader) 2590 else: 2591 reader.next_element() 2592 for link in links: 2593 ConsoleReader._process_link(link, obj) 2594 2595 # Discard the end tag: 2596 reader.read() 2597 2598 return obj 2599 2600 @staticmethod 2601 def read_many(reader): 2602 # Do nothing if there aren't more tags: 2603 objs = List() 2604 if not reader.forward(): 2605 return objs 2606 2607 # Process the attributes: 2608 objs.href = reader.get_attribute('href') 2609 2610 # Discard the start tag: 2611 empty = reader.empty_element() 2612 reader.read() 2613 if empty: 2614 return objs 2615 2616 # Process the inner elements: 2617 while reader.forward(): 2618 objs.append(ConsoleReader.read_one(reader)) 2619 2620 # Discard the end tag: 2621 reader.read() 2622 2623 return objs 2624 2625 2626class CoreReader(Reader): 2627 2628 def __init__(self): 2629 super(CoreReader, self).__init__() 2630 2631 @staticmethod 2632 def read_one(reader): 2633 # Do nothing if there aren't more tags: 2634 if not reader.forward(): 2635 return None 2636 2637 # Create the object: 2638 obj = types.Core() 2639 2640 # Process the attributes: 2641 obj.href = reader.get_attribute('href') 2642 2643 # Discard the start tag: 2644 empty = reader.empty_element() 2645 reader.read() 2646 if empty: 2647 return obj 2648 2649 # Process the inner elements: 2650 links = [] 2651 while reader.forward(): 2652 tag = reader.node_name() 2653 if tag == 'index': 2654 obj.index = Reader.read_integer(reader) 2655 elif tag == 'socket': 2656 obj.socket = Reader.read_integer(reader) 2657 else: 2658 reader.next_element() 2659 for link in links: 2660 CoreReader._process_link(link, obj) 2661 2662 # Discard the end tag: 2663 reader.read() 2664 2665 return obj 2666 2667 @staticmethod 2668 def read_many(reader): 2669 # Do nothing if there aren't more tags: 2670 objs = List() 2671 if not reader.forward(): 2672 return objs 2673 2674 # Process the attributes: 2675 objs.href = reader.get_attribute('href') 2676 2677 # Discard the start tag: 2678 empty = reader.empty_element() 2679 reader.read() 2680 if empty: 2681 return objs 2682 2683 # Process the inner elements: 2684 while reader.forward(): 2685 objs.append(CoreReader.read_one(reader)) 2686 2687 # Discard the end tag: 2688 reader.read() 2689 2690 return objs 2691 2692 2693class CpuReader(Reader): 2694 2695 def __init__(self): 2696 super(CpuReader, self).__init__() 2697 2698 @staticmethod 2699 def read_one(reader): 2700 # Do nothing if there aren't more tags: 2701 if not reader.forward(): 2702 return None 2703 2704 # Create the object: 2705 obj = types.Cpu() 2706 2707 # Process the attributes: 2708 obj.href = reader.get_attribute('href') 2709 2710 # Discard the start tag: 2711 empty = reader.empty_element() 2712 reader.read() 2713 if empty: 2714 return obj 2715 2716 # Process the inner elements: 2717 links = [] 2718 while reader.forward(): 2719 tag = reader.node_name() 2720 if tag == 'architecture': 2721 obj.architecture = Reader.read_enum(types.Architecture, reader) 2722 elif tag == 'cores': 2723 obj.cores = CoreReader.read_many(reader) 2724 elif tag == 'cpu_tune': 2725 obj.cpu_tune = CpuTuneReader.read_one(reader) 2726 elif tag == 'level': 2727 obj.level = Reader.read_integer(reader) 2728 elif tag == 'mode': 2729 obj.mode = Reader.read_enum(types.CpuMode, reader) 2730 elif tag == 'name': 2731 obj.name = Reader.read_string(reader) 2732 elif tag == 'speed': 2733 obj.speed = Reader.read_decimal(reader) 2734 elif tag == 'topology': 2735 obj.topology = CpuTopologyReader.read_one(reader) 2736 elif tag == 'type': 2737 obj.type = Reader.read_string(reader) 2738 else: 2739 reader.next_element() 2740 for link in links: 2741 CpuReader._process_link(link, obj) 2742 2743 # Discard the end tag: 2744 reader.read() 2745 2746 return obj 2747 2748 @staticmethod 2749 def read_many(reader): 2750 # Do nothing if there aren't more tags: 2751 objs = List() 2752 if not reader.forward(): 2753 return objs 2754 2755 # Process the attributes: 2756 objs.href = reader.get_attribute('href') 2757 2758 # Discard the start tag: 2759 empty = reader.empty_element() 2760 reader.read() 2761 if empty: 2762 return objs 2763 2764 # Process the inner elements: 2765 while reader.forward(): 2766 objs.append(CpuReader.read_one(reader)) 2767 2768 # Discard the end tag: 2769 reader.read() 2770 2771 return objs 2772 2773 2774class CpuProfileReader(Reader): 2775 2776 def __init__(self): 2777 super(CpuProfileReader, self).__init__() 2778 2779 @staticmethod 2780 def read_one(reader): 2781 # Do nothing if there aren't more tags: 2782 if not reader.forward(): 2783 return None 2784 2785 # Create the object: 2786 obj = types.CpuProfile() 2787 2788 # Process the attributes: 2789 obj.href = reader.get_attribute('href') 2790 value = reader.get_attribute('id') 2791 if value is not None: 2792 obj.id = value 2793 2794 # Discard the start tag: 2795 empty = reader.empty_element() 2796 reader.read() 2797 if empty: 2798 return obj 2799 2800 # Process the inner elements: 2801 links = [] 2802 while reader.forward(): 2803 tag = reader.node_name() 2804 if tag == 'cluster': 2805 obj.cluster = ClusterReader.read_one(reader) 2806 elif tag == 'comment': 2807 obj.comment = Reader.read_string(reader) 2808 elif tag == 'description': 2809 obj.description = Reader.read_string(reader) 2810 elif tag == 'name': 2811 obj.name = Reader.read_string(reader) 2812 elif tag == 'permissions': 2813 obj.permissions = PermissionReader.read_many(reader) 2814 elif tag == 'qos': 2815 obj.qos = QosReader.read_one(reader) 2816 elif tag == 'link': 2817 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2818 reader.next_element() 2819 else: 2820 reader.next_element() 2821 for link in links: 2822 CpuProfileReader._process_link(link, obj) 2823 2824 # Discard the end tag: 2825 reader.read() 2826 2827 return obj 2828 2829 @staticmethod 2830 def read_many(reader): 2831 # Do nothing if there aren't more tags: 2832 objs = List() 2833 if not reader.forward(): 2834 return objs 2835 2836 # Process the attributes: 2837 objs.href = reader.get_attribute('href') 2838 2839 # Discard the start tag: 2840 empty = reader.empty_element() 2841 reader.read() 2842 if empty: 2843 return objs 2844 2845 # Process the inner elements: 2846 while reader.forward(): 2847 objs.append(CpuProfileReader.read_one(reader)) 2848 2849 # Discard the end tag: 2850 reader.read() 2851 2852 return objs 2853 2854 @staticmethod 2855 def _process_link(link, obj): 2856 # Process the attributes: 2857 rel = link[0] 2858 href = link[1] 2859 if href and rel: 2860 if rel == "permissions": 2861 if obj.permissions is not None: 2862 obj.permissions.href = href 2863 else: 2864 obj.permissions = List(href) 2865 2866 2867class CpuTopologyReader(Reader): 2868 2869 def __init__(self): 2870 super(CpuTopologyReader, self).__init__() 2871 2872 @staticmethod 2873 def read_one(reader): 2874 # Do nothing if there aren't more tags: 2875 if not reader.forward(): 2876 return None 2877 2878 # Create the object: 2879 obj = types.CpuTopology() 2880 2881 # Process the attributes: 2882 obj.href = reader.get_attribute('href') 2883 2884 # Discard the start tag: 2885 empty = reader.empty_element() 2886 reader.read() 2887 if empty: 2888 return obj 2889 2890 # Process the inner elements: 2891 links = [] 2892 while reader.forward(): 2893 tag = reader.node_name() 2894 if tag == 'cores': 2895 obj.cores = Reader.read_integer(reader) 2896 elif tag == 'sockets': 2897 obj.sockets = Reader.read_integer(reader) 2898 elif tag == 'threads': 2899 obj.threads = Reader.read_integer(reader) 2900 else: 2901 reader.next_element() 2902 for link in links: 2903 CpuTopologyReader._process_link(link, obj) 2904 2905 # Discard the end tag: 2906 reader.read() 2907 2908 return obj 2909 2910 @staticmethod 2911 def read_many(reader): 2912 # Do nothing if there aren't more tags: 2913 objs = List() 2914 if not reader.forward(): 2915 return objs 2916 2917 # Process the attributes: 2918 objs.href = reader.get_attribute('href') 2919 2920 # Discard the start tag: 2921 empty = reader.empty_element() 2922 reader.read() 2923 if empty: 2924 return objs 2925 2926 # Process the inner elements: 2927 while reader.forward(): 2928 objs.append(CpuTopologyReader.read_one(reader)) 2929 2930 # Discard the end tag: 2931 reader.read() 2932 2933 return objs 2934 2935 2936class CpuTuneReader(Reader): 2937 2938 def __init__(self): 2939 super(CpuTuneReader, self).__init__() 2940 2941 @staticmethod 2942 def read_one(reader): 2943 # Do nothing if there aren't more tags: 2944 if not reader.forward(): 2945 return None 2946 2947 # Create the object: 2948 obj = types.CpuTune() 2949 2950 # Process the attributes: 2951 obj.href = reader.get_attribute('href') 2952 2953 # Discard the start tag: 2954 empty = reader.empty_element() 2955 reader.read() 2956 if empty: 2957 return obj 2958 2959 # Process the inner elements: 2960 links = [] 2961 while reader.forward(): 2962 tag = reader.node_name() 2963 if tag == 'vcpu_pins': 2964 obj.vcpu_pins = VcpuPinReader.read_many(reader) 2965 else: 2966 reader.next_element() 2967 for link in links: 2968 CpuTuneReader._process_link(link, obj) 2969 2970 # Discard the end tag: 2971 reader.read() 2972 2973 return obj 2974 2975 @staticmethod 2976 def read_many(reader): 2977 # Do nothing if there aren't more tags: 2978 objs = List() 2979 if not reader.forward(): 2980 return objs 2981 2982 # Process the attributes: 2983 objs.href = reader.get_attribute('href') 2984 2985 # Discard the start tag: 2986 empty = reader.empty_element() 2987 reader.read() 2988 if empty: 2989 return objs 2990 2991 # Process the inner elements: 2992 while reader.forward(): 2993 objs.append(CpuTuneReader.read_one(reader)) 2994 2995 # Discard the end tag: 2996 reader.read() 2997 2998 return objs 2999 3000 3001class CpuTypeReader(Reader): 3002 3003 def __init__(self): 3004 super(CpuTypeReader, self).__init__() 3005 3006 @staticmethod 3007 def read_one(reader): 3008 # Do nothing if there aren't more tags: 3009 if not reader.forward(): 3010 return None 3011 3012 # Create the object: 3013 obj = types.CpuType() 3014 3015 # Process the attributes: 3016 obj.href = reader.get_attribute('href') 3017 3018 # Discard the start tag: 3019 empty = reader.empty_element() 3020 reader.read() 3021 if empty: 3022 return obj 3023 3024 # Process the inner elements: 3025 links = [] 3026 while reader.forward(): 3027 tag = reader.node_name() 3028 if tag == 'architecture': 3029 obj.architecture = Reader.read_enum(types.Architecture, reader) 3030 elif tag == 'level': 3031 obj.level = Reader.read_integer(reader) 3032 elif tag == 'name': 3033 obj.name = Reader.read_string(reader) 3034 else: 3035 reader.next_element() 3036 for link in links: 3037 CpuTypeReader._process_link(link, obj) 3038 3039 # Discard the end tag: 3040 reader.read() 3041 3042 return obj 3043 3044 @staticmethod 3045 def read_many(reader): 3046 # Do nothing if there aren't more tags: 3047 objs = List() 3048 if not reader.forward(): 3049 return objs 3050 3051 # Process the attributes: 3052 objs.href = reader.get_attribute('href') 3053 3054 # Discard the start tag: 3055 empty = reader.empty_element() 3056 reader.read() 3057 if empty: 3058 return objs 3059 3060 # Process the inner elements: 3061 while reader.forward(): 3062 objs.append(CpuTypeReader.read_one(reader)) 3063 3064 # Discard the end tag: 3065 reader.read() 3066 3067 return objs 3068 3069 3070class CustomPropertyReader(Reader): 3071 3072 def __init__(self): 3073 super(CustomPropertyReader, self).__init__() 3074 3075 @staticmethod 3076 def read_one(reader): 3077 # Do nothing if there aren't more tags: 3078 if not reader.forward(): 3079 return None 3080 3081 # Create the object: 3082 obj = types.CustomProperty() 3083 3084 # Process the attributes: 3085 obj.href = reader.get_attribute('href') 3086 3087 # Discard the start tag: 3088 empty = reader.empty_element() 3089 reader.read() 3090 if empty: 3091 return obj 3092 3093 # Process the inner elements: 3094 links = [] 3095 while reader.forward(): 3096 tag = reader.node_name() 3097 if tag == 'name': 3098 obj.name = Reader.read_string(reader) 3099 elif tag == 'regexp': 3100 obj.regexp = Reader.read_string(reader) 3101 elif tag == 'value': 3102 obj.value = Reader.read_string(reader) 3103 else: 3104 reader.next_element() 3105 for link in links: 3106 CustomPropertyReader._process_link(link, obj) 3107 3108 # Discard the end tag: 3109 reader.read() 3110 3111 return obj 3112 3113 @staticmethod 3114 def read_many(reader): 3115 # Do nothing if there aren't more tags: 3116 objs = List() 3117 if not reader.forward(): 3118 return objs 3119 3120 # Process the attributes: 3121 objs.href = reader.get_attribute('href') 3122 3123 # Discard the start tag: 3124 empty = reader.empty_element() 3125 reader.read() 3126 if empty: 3127 return objs 3128 3129 # Process the inner elements: 3130 while reader.forward(): 3131 objs.append(CustomPropertyReader.read_one(reader)) 3132 3133 # Discard the end tag: 3134 reader.read() 3135 3136 return objs 3137 3138 3139class DataCenterReader(Reader): 3140 3141 def __init__(self): 3142 super(DataCenterReader, self).__init__() 3143 3144 @staticmethod 3145 def read_one(reader): 3146 # Do nothing if there aren't more tags: 3147 if not reader.forward(): 3148 return None 3149 3150 # Create the object: 3151 obj = types.DataCenter() 3152 3153 # Process the attributes: 3154 obj.href = reader.get_attribute('href') 3155 value = reader.get_attribute('id') 3156 if value is not None: 3157 obj.id = value 3158 3159 # Discard the start tag: 3160 empty = reader.empty_element() 3161 reader.read() 3162 if empty: 3163 return obj 3164 3165 # Process the inner elements: 3166 links = [] 3167 while reader.forward(): 3168 tag = reader.node_name() 3169 if tag == 'clusters': 3170 obj.clusters = ClusterReader.read_many(reader) 3171 elif tag == 'comment': 3172 obj.comment = Reader.read_string(reader) 3173 elif tag == 'description': 3174 obj.description = Reader.read_string(reader) 3175 elif tag == 'iscsi_bonds': 3176 obj.iscsi_bonds = IscsiBondReader.read_many(reader) 3177 elif tag == 'local': 3178 obj.local = Reader.read_boolean(reader) 3179 elif tag == 'mac_pool': 3180 obj.mac_pool = MacPoolReader.read_one(reader) 3181 elif tag == 'name': 3182 obj.name = Reader.read_string(reader) 3183 elif tag == 'networks': 3184 obj.networks = NetworkReader.read_many(reader) 3185 elif tag == 'permissions': 3186 obj.permissions = PermissionReader.read_many(reader) 3187 elif tag == 'qoss': 3188 obj.qoss = QosReader.read_many(reader) 3189 elif tag == 'quota_mode': 3190 obj.quota_mode = Reader.read_enum(types.QuotaModeType, reader) 3191 elif tag == 'quotas': 3192 obj.quotas = QuotaReader.read_many(reader) 3193 elif tag == 'status': 3194 obj.status = Reader.read_enum(types.DataCenterStatus, reader) 3195 elif tag == 'storage_domains': 3196 obj.storage_domains = StorageDomainReader.read_many(reader) 3197 elif tag == 'storage_format': 3198 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 3199 elif tag == 'supported_versions': 3200 obj.supported_versions = VersionReader.read_many(reader) 3201 elif tag == 'version': 3202 obj.version = VersionReader.read_one(reader) 3203 elif tag == 'link': 3204 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3205 reader.next_element() 3206 else: 3207 reader.next_element() 3208 for link in links: 3209 DataCenterReader._process_link(link, obj) 3210 3211 # Discard the end tag: 3212 reader.read() 3213 3214 return obj 3215 3216 @staticmethod 3217 def read_many(reader): 3218 # Do nothing if there aren't more tags: 3219 objs = List() 3220 if not reader.forward(): 3221 return objs 3222 3223 # Process the attributes: 3224 objs.href = reader.get_attribute('href') 3225 3226 # Discard the start tag: 3227 empty = reader.empty_element() 3228 reader.read() 3229 if empty: 3230 return objs 3231 3232 # Process the inner elements: 3233 while reader.forward(): 3234 objs.append(DataCenterReader.read_one(reader)) 3235 3236 # Discard the end tag: 3237 reader.read() 3238 3239 return objs 3240 3241 @staticmethod 3242 def _process_link(link, obj): 3243 # Process the attributes: 3244 rel = link[0] 3245 href = link[1] 3246 if href and rel: 3247 if rel == "clusters": 3248 if obj.clusters is not None: 3249 obj.clusters.href = href 3250 else: 3251 obj.clusters = List(href) 3252 elif rel == "iscsibonds": 3253 if obj.iscsi_bonds is not None: 3254 obj.iscsi_bonds.href = href 3255 else: 3256 obj.iscsi_bonds = List(href) 3257 elif rel == "networks": 3258 if obj.networks is not None: 3259 obj.networks.href = href 3260 else: 3261 obj.networks = List(href) 3262 elif rel == "permissions": 3263 if obj.permissions is not None: 3264 obj.permissions.href = href 3265 else: 3266 obj.permissions = List(href) 3267 elif rel == "qoss": 3268 if obj.qoss is not None: 3269 obj.qoss.href = href 3270 else: 3271 obj.qoss = List(href) 3272 elif rel == "quotas": 3273 if obj.quotas is not None: 3274 obj.quotas.href = href 3275 else: 3276 obj.quotas = List(href) 3277 elif rel == "storagedomains": 3278 if obj.storage_domains is not None: 3279 obj.storage_domains.href = href 3280 else: 3281 obj.storage_domains = List(href) 3282 3283 3284class DeviceReader(Reader): 3285 3286 def __init__(self): 3287 super(DeviceReader, self).__init__() 3288 3289 @staticmethod 3290 def read_one(reader): 3291 # Do nothing if there aren't more tags: 3292 if not reader.forward(): 3293 return None 3294 3295 # Create the object: 3296 obj = types.Device() 3297 3298 # Process the attributes: 3299 obj.href = reader.get_attribute('href') 3300 value = reader.get_attribute('id') 3301 if value is not None: 3302 obj.id = value 3303 3304 # Discard the start tag: 3305 empty = reader.empty_element() 3306 reader.read() 3307 if empty: 3308 return obj 3309 3310 # Process the inner elements: 3311 links = [] 3312 while reader.forward(): 3313 tag = reader.node_name() 3314 if tag == 'comment': 3315 obj.comment = Reader.read_string(reader) 3316 elif tag == 'description': 3317 obj.description = Reader.read_string(reader) 3318 elif tag == 'instance_type': 3319 obj.instance_type = InstanceTypeReader.read_one(reader) 3320 elif tag == 'name': 3321 obj.name = Reader.read_string(reader) 3322 elif tag == 'template': 3323 obj.template = TemplateReader.read_one(reader) 3324 elif tag == 'vm': 3325 obj.vm = VmReader.read_one(reader) 3326 elif tag == 'vms': 3327 obj.vms = VmReader.read_many(reader) 3328 elif tag == 'link': 3329 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3330 reader.next_element() 3331 else: 3332 reader.next_element() 3333 for link in links: 3334 DeviceReader._process_link(link, obj) 3335 3336 # Discard the end tag: 3337 reader.read() 3338 3339 return obj 3340 3341 @staticmethod 3342 def read_many(reader): 3343 # Do nothing if there aren't more tags: 3344 objs = List() 3345 if not reader.forward(): 3346 return objs 3347 3348 # Process the attributes: 3349 objs.href = reader.get_attribute('href') 3350 3351 # Discard the start tag: 3352 empty = reader.empty_element() 3353 reader.read() 3354 if empty: 3355 return objs 3356 3357 # Process the inner elements: 3358 while reader.forward(): 3359 objs.append(DeviceReader.read_one(reader)) 3360 3361 # Discard the end tag: 3362 reader.read() 3363 3364 return objs 3365 3366 @staticmethod 3367 def _process_link(link, obj): 3368 # Process the attributes: 3369 rel = link[0] 3370 href = link[1] 3371 if href and rel: 3372 if rel == "vms": 3373 if obj.vms is not None: 3374 obj.vms.href = href 3375 else: 3376 obj.vms = List(href) 3377 3378 3379class DiskReader(Reader): 3380 3381 def __init__(self): 3382 super(DiskReader, self).__init__() 3383 3384 @staticmethod 3385 def read_one(reader): 3386 # Do nothing if there aren't more tags: 3387 if not reader.forward(): 3388 return None 3389 3390 # Create the object: 3391 obj = types.Disk() 3392 3393 # Process the attributes: 3394 obj.href = reader.get_attribute('href') 3395 value = reader.get_attribute('id') 3396 if value is not None: 3397 obj.id = value 3398 3399 # Discard the start tag: 3400 empty = reader.empty_element() 3401 reader.read() 3402 if empty: 3403 return obj 3404 3405 # Process the inner elements: 3406 links = [] 3407 while reader.forward(): 3408 tag = reader.node_name() 3409 if tag == 'active': 3410 obj.active = Reader.read_boolean(reader) 3411 elif tag == 'actual_size': 3412 obj.actual_size = Reader.read_integer(reader) 3413 elif tag == 'alias': 3414 obj.alias = Reader.read_string(reader) 3415 elif tag == 'backup': 3416 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3417 elif tag == 'backup_mode': 3418 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3419 elif tag == 'bootable': 3420 obj.bootable = Reader.read_boolean(reader) 3421 elif tag == 'comment': 3422 obj.comment = Reader.read_string(reader) 3423 elif tag == 'content_type': 3424 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3425 elif tag == 'description': 3426 obj.description = Reader.read_string(reader) 3427 elif tag == 'disk_profile': 3428 obj.disk_profile = DiskProfileReader.read_one(reader) 3429 elif tag == 'disk_snapshots': 3430 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3431 elif tag == 'external_disk': 3432 obj.external_disk = Reader.read_string(reader) 3433 elif tag == 'format': 3434 obj.format = Reader.read_enum(types.DiskFormat, reader) 3435 elif tag == 'image_id': 3436 obj.image_id = Reader.read_string(reader) 3437 elif tag == 'initial_size': 3438 obj.initial_size = Reader.read_integer(reader) 3439 elif tag == 'instance_type': 3440 obj.instance_type = InstanceTypeReader.read_one(reader) 3441 elif tag == 'interface': 3442 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3443 elif tag == 'logical_name': 3444 obj.logical_name = Reader.read_string(reader) 3445 elif tag == 'lun_storage': 3446 obj.lun_storage = HostStorageReader.read_one(reader) 3447 elif tag == 'name': 3448 obj.name = Reader.read_string(reader) 3449 elif tag == 'openstack_volume_type': 3450 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3451 elif tag == 'permissions': 3452 obj.permissions = PermissionReader.read_many(reader) 3453 elif tag == 'propagate_errors': 3454 obj.propagate_errors = Reader.read_boolean(reader) 3455 elif tag == 'provisioned_size': 3456 obj.provisioned_size = Reader.read_integer(reader) 3457 elif tag == 'qcow_version': 3458 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3459 elif tag == 'quota': 3460 obj.quota = QuotaReader.read_one(reader) 3461 elif tag == 'read_only': 3462 obj.read_only = Reader.read_boolean(reader) 3463 elif tag == 'sgio': 3464 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3465 elif tag == 'shareable': 3466 obj.shareable = Reader.read_boolean(reader) 3467 elif tag == 'snapshot': 3468 obj.snapshot = SnapshotReader.read_one(reader) 3469 elif tag == 'sparse': 3470 obj.sparse = Reader.read_boolean(reader) 3471 elif tag == 'statistics': 3472 obj.statistics = StatisticReader.read_many(reader) 3473 elif tag == 'status': 3474 obj.status = Reader.read_enum(types.DiskStatus, reader) 3475 elif tag == 'storage_domain': 3476 obj.storage_domain = StorageDomainReader.read_one(reader) 3477 elif tag == 'storage_domains': 3478 obj.storage_domains = StorageDomainReader.read_many(reader) 3479 elif tag == 'storage_type': 3480 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3481 elif tag == 'template': 3482 obj.template = TemplateReader.read_one(reader) 3483 elif tag == 'total_size': 3484 obj.total_size = Reader.read_integer(reader) 3485 elif tag == 'uses_scsi_reservation': 3486 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3487 elif tag == 'vm': 3488 obj.vm = VmReader.read_one(reader) 3489 elif tag == 'vms': 3490 obj.vms = VmReader.read_many(reader) 3491 elif tag == 'wipe_after_delete': 3492 obj.wipe_after_delete = Reader.read_boolean(reader) 3493 elif tag == 'link': 3494 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3495 reader.next_element() 3496 else: 3497 reader.next_element() 3498 for link in links: 3499 DiskReader._process_link(link, obj) 3500 3501 # Discard the end tag: 3502 reader.read() 3503 3504 return obj 3505 3506 @staticmethod 3507 def read_many(reader): 3508 # Do nothing if there aren't more tags: 3509 objs = List() 3510 if not reader.forward(): 3511 return objs 3512 3513 # Process the attributes: 3514 objs.href = reader.get_attribute('href') 3515 3516 # Discard the start tag: 3517 empty = reader.empty_element() 3518 reader.read() 3519 if empty: 3520 return objs 3521 3522 # Process the inner elements: 3523 while reader.forward(): 3524 objs.append(DiskReader.read_one(reader)) 3525 3526 # Discard the end tag: 3527 reader.read() 3528 3529 return objs 3530 3531 @staticmethod 3532 def _process_link(link, obj): 3533 # Process the attributes: 3534 rel = link[0] 3535 href = link[1] 3536 if href and rel: 3537 if rel == "disksnapshots": 3538 if obj.disk_snapshots is not None: 3539 obj.disk_snapshots.href = href 3540 else: 3541 obj.disk_snapshots = List(href) 3542 elif rel == "permissions": 3543 if obj.permissions is not None: 3544 obj.permissions.href = href 3545 else: 3546 obj.permissions = List(href) 3547 elif rel == "statistics": 3548 if obj.statistics is not None: 3549 obj.statistics.href = href 3550 else: 3551 obj.statistics = List(href) 3552 elif rel == "storagedomains": 3553 if obj.storage_domains is not None: 3554 obj.storage_domains.href = href 3555 else: 3556 obj.storage_domains = List(href) 3557 elif rel == "vms": 3558 if obj.vms is not None: 3559 obj.vms.href = href 3560 else: 3561 obj.vms = List(href) 3562 3563 3564class DiskAttachmentReader(Reader): 3565 3566 def __init__(self): 3567 super(DiskAttachmentReader, self).__init__() 3568 3569 @staticmethod 3570 def read_one(reader): 3571 # Do nothing if there aren't more tags: 3572 if not reader.forward(): 3573 return None 3574 3575 # Create the object: 3576 obj = types.DiskAttachment() 3577 3578 # Process the attributes: 3579 obj.href = reader.get_attribute('href') 3580 value = reader.get_attribute('id') 3581 if value is not None: 3582 obj.id = value 3583 3584 # Discard the start tag: 3585 empty = reader.empty_element() 3586 reader.read() 3587 if empty: 3588 return obj 3589 3590 # Process the inner elements: 3591 links = [] 3592 while reader.forward(): 3593 tag = reader.node_name() 3594 if tag == 'active': 3595 obj.active = Reader.read_boolean(reader) 3596 elif tag == 'bootable': 3597 obj.bootable = Reader.read_boolean(reader) 3598 elif tag == 'comment': 3599 obj.comment = Reader.read_string(reader) 3600 elif tag == 'description': 3601 obj.description = Reader.read_string(reader) 3602 elif tag == 'disk': 3603 obj.disk = DiskReader.read_one(reader) 3604 elif tag == 'interface': 3605 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3606 elif tag == 'logical_name': 3607 obj.logical_name = Reader.read_string(reader) 3608 elif tag == 'name': 3609 obj.name = Reader.read_string(reader) 3610 elif tag == 'pass_discard': 3611 obj.pass_discard = Reader.read_boolean(reader) 3612 elif tag == 'read_only': 3613 obj.read_only = Reader.read_boolean(reader) 3614 elif tag == 'template': 3615 obj.template = TemplateReader.read_one(reader) 3616 elif tag == 'uses_scsi_reservation': 3617 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3618 elif tag == 'vm': 3619 obj.vm = VmReader.read_one(reader) 3620 else: 3621 reader.next_element() 3622 for link in links: 3623 DiskAttachmentReader._process_link(link, obj) 3624 3625 # Discard the end tag: 3626 reader.read() 3627 3628 return obj 3629 3630 @staticmethod 3631 def read_many(reader): 3632 # Do nothing if there aren't more tags: 3633 objs = List() 3634 if not reader.forward(): 3635 return objs 3636 3637 # Process the attributes: 3638 objs.href = reader.get_attribute('href') 3639 3640 # Discard the start tag: 3641 empty = reader.empty_element() 3642 reader.read() 3643 if empty: 3644 return objs 3645 3646 # Process the inner elements: 3647 while reader.forward(): 3648 objs.append(DiskAttachmentReader.read_one(reader)) 3649 3650 # Discard the end tag: 3651 reader.read() 3652 3653 return objs 3654 3655 3656class DiskProfileReader(Reader): 3657 3658 def __init__(self): 3659 super(DiskProfileReader, self).__init__() 3660 3661 @staticmethod 3662 def read_one(reader): 3663 # Do nothing if there aren't more tags: 3664 if not reader.forward(): 3665 return None 3666 3667 # Create the object: 3668 obj = types.DiskProfile() 3669 3670 # Process the attributes: 3671 obj.href = reader.get_attribute('href') 3672 value = reader.get_attribute('id') 3673 if value is not None: 3674 obj.id = value 3675 3676 # Discard the start tag: 3677 empty = reader.empty_element() 3678 reader.read() 3679 if empty: 3680 return obj 3681 3682 # Process the inner elements: 3683 links = [] 3684 while reader.forward(): 3685 tag = reader.node_name() 3686 if tag == 'comment': 3687 obj.comment = Reader.read_string(reader) 3688 elif tag == 'description': 3689 obj.description = Reader.read_string(reader) 3690 elif tag == 'name': 3691 obj.name = Reader.read_string(reader) 3692 elif tag == 'permissions': 3693 obj.permissions = PermissionReader.read_many(reader) 3694 elif tag == 'qos': 3695 obj.qos = QosReader.read_one(reader) 3696 elif tag == 'storage_domain': 3697 obj.storage_domain = StorageDomainReader.read_one(reader) 3698 elif tag == 'link': 3699 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3700 reader.next_element() 3701 else: 3702 reader.next_element() 3703 for link in links: 3704 DiskProfileReader._process_link(link, obj) 3705 3706 # Discard the end tag: 3707 reader.read() 3708 3709 return obj 3710 3711 @staticmethod 3712 def read_many(reader): 3713 # Do nothing if there aren't more tags: 3714 objs = List() 3715 if not reader.forward(): 3716 return objs 3717 3718 # Process the attributes: 3719 objs.href = reader.get_attribute('href') 3720 3721 # Discard the start tag: 3722 empty = reader.empty_element() 3723 reader.read() 3724 if empty: 3725 return objs 3726 3727 # Process the inner elements: 3728 while reader.forward(): 3729 objs.append(DiskProfileReader.read_one(reader)) 3730 3731 # Discard the end tag: 3732 reader.read() 3733 3734 return objs 3735 3736 @staticmethod 3737 def _process_link(link, obj): 3738 # Process the attributes: 3739 rel = link[0] 3740 href = link[1] 3741 if href and rel: 3742 if rel == "permissions": 3743 if obj.permissions is not None: 3744 obj.permissions.href = href 3745 else: 3746 obj.permissions = List(href) 3747 3748 3749class DiskSnapshotReader(Reader): 3750 3751 def __init__(self): 3752 super(DiskSnapshotReader, self).__init__() 3753 3754 @staticmethod 3755 def read_one(reader): 3756 # Do nothing if there aren't more tags: 3757 if not reader.forward(): 3758 return None 3759 3760 # Create the object: 3761 obj = types.DiskSnapshot() 3762 3763 # Process the attributes: 3764 obj.href = reader.get_attribute('href') 3765 value = reader.get_attribute('id') 3766 if value is not None: 3767 obj.id = value 3768 3769 # Discard the start tag: 3770 empty = reader.empty_element() 3771 reader.read() 3772 if empty: 3773 return obj 3774 3775 # Process the inner elements: 3776 links = [] 3777 while reader.forward(): 3778 tag = reader.node_name() 3779 if tag == 'active': 3780 obj.active = Reader.read_boolean(reader) 3781 elif tag == 'actual_size': 3782 obj.actual_size = Reader.read_integer(reader) 3783 elif tag == 'alias': 3784 obj.alias = Reader.read_string(reader) 3785 elif tag == 'backup': 3786 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3787 elif tag == 'backup_mode': 3788 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3789 elif tag == 'bootable': 3790 obj.bootable = Reader.read_boolean(reader) 3791 elif tag == 'comment': 3792 obj.comment = Reader.read_string(reader) 3793 elif tag == 'content_type': 3794 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3795 elif tag == 'description': 3796 obj.description = Reader.read_string(reader) 3797 elif tag == 'disk': 3798 obj.disk = DiskReader.read_one(reader) 3799 elif tag == 'disk_profile': 3800 obj.disk_profile = DiskProfileReader.read_one(reader) 3801 elif tag == 'disk_snapshots': 3802 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3803 elif tag == 'external_disk': 3804 obj.external_disk = Reader.read_string(reader) 3805 elif tag == 'format': 3806 obj.format = Reader.read_enum(types.DiskFormat, reader) 3807 elif tag == 'image_id': 3808 obj.image_id = Reader.read_string(reader) 3809 elif tag == 'initial_size': 3810 obj.initial_size = Reader.read_integer(reader) 3811 elif tag == 'instance_type': 3812 obj.instance_type = InstanceTypeReader.read_one(reader) 3813 elif tag == 'interface': 3814 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3815 elif tag == 'logical_name': 3816 obj.logical_name = Reader.read_string(reader) 3817 elif tag == 'lun_storage': 3818 obj.lun_storage = HostStorageReader.read_one(reader) 3819 elif tag == 'name': 3820 obj.name = Reader.read_string(reader) 3821 elif tag == 'openstack_volume_type': 3822 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3823 elif tag == 'parent': 3824 obj.parent = DiskSnapshotReader.read_one(reader) 3825 elif tag == 'permissions': 3826 obj.permissions = PermissionReader.read_many(reader) 3827 elif tag == 'propagate_errors': 3828 obj.propagate_errors = Reader.read_boolean(reader) 3829 elif tag == 'provisioned_size': 3830 obj.provisioned_size = Reader.read_integer(reader) 3831 elif tag == 'qcow_version': 3832 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3833 elif tag == 'quota': 3834 obj.quota = QuotaReader.read_one(reader) 3835 elif tag == 'read_only': 3836 obj.read_only = Reader.read_boolean(reader) 3837 elif tag == 'sgio': 3838 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3839 elif tag == 'shareable': 3840 obj.shareable = Reader.read_boolean(reader) 3841 elif tag == 'snapshot': 3842 obj.snapshot = SnapshotReader.read_one(reader) 3843 elif tag == 'sparse': 3844 obj.sparse = Reader.read_boolean(reader) 3845 elif tag == 'statistics': 3846 obj.statistics = StatisticReader.read_many(reader) 3847 elif tag == 'status': 3848 obj.status = Reader.read_enum(types.DiskStatus, reader) 3849 elif tag == 'storage_domain': 3850 obj.storage_domain = StorageDomainReader.read_one(reader) 3851 elif tag == 'storage_domains': 3852 obj.storage_domains = StorageDomainReader.read_many(reader) 3853 elif tag == 'storage_type': 3854 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3855 elif tag == 'template': 3856 obj.template = TemplateReader.read_one(reader) 3857 elif tag == 'total_size': 3858 obj.total_size = Reader.read_integer(reader) 3859 elif tag == 'uses_scsi_reservation': 3860 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3861 elif tag == 'vm': 3862 obj.vm = VmReader.read_one(reader) 3863 elif tag == 'vms': 3864 obj.vms = VmReader.read_many(reader) 3865 elif tag == 'wipe_after_delete': 3866 obj.wipe_after_delete = Reader.read_boolean(reader) 3867 elif tag == 'link': 3868 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3869 reader.next_element() 3870 else: 3871 reader.next_element() 3872 for link in links: 3873 DiskSnapshotReader._process_link(link, obj) 3874 3875 # Discard the end tag: 3876 reader.read() 3877 3878 return obj 3879 3880 @staticmethod 3881 def read_many(reader): 3882 # Do nothing if there aren't more tags: 3883 objs = List() 3884 if not reader.forward(): 3885 return objs 3886 3887 # Process the attributes: 3888 objs.href = reader.get_attribute('href') 3889 3890 # Discard the start tag: 3891 empty = reader.empty_element() 3892 reader.read() 3893 if empty: 3894 return objs 3895 3896 # Process the inner elements: 3897 while reader.forward(): 3898 objs.append(DiskSnapshotReader.read_one(reader)) 3899 3900 # Discard the end tag: 3901 reader.read() 3902 3903 return objs 3904 3905 @staticmethod 3906 def _process_link(link, obj): 3907 # Process the attributes: 3908 rel = link[0] 3909 href = link[1] 3910 if href and rel: 3911 if rel == "disksnapshots": 3912 if obj.disk_snapshots is not None: 3913 obj.disk_snapshots.href = href 3914 else: 3915 obj.disk_snapshots = List(href) 3916 elif rel == "permissions": 3917 if obj.permissions is not None: 3918 obj.permissions.href = href 3919 else: 3920 obj.permissions = List(href) 3921 elif rel == "statistics": 3922 if obj.statistics is not None: 3923 obj.statistics.href = href 3924 else: 3925 obj.statistics = List(href) 3926 elif rel == "storagedomains": 3927 if obj.storage_domains is not None: 3928 obj.storage_domains.href = href 3929 else: 3930 obj.storage_domains = List(href) 3931 elif rel == "vms": 3932 if obj.vms is not None: 3933 obj.vms.href = href 3934 else: 3935 obj.vms = List(href) 3936 3937 3938class DisplayReader(Reader): 3939 3940 def __init__(self): 3941 super(DisplayReader, self).__init__() 3942 3943 @staticmethod 3944 def read_one(reader): 3945 # Do nothing if there aren't more tags: 3946 if not reader.forward(): 3947 return None 3948 3949 # Create the object: 3950 obj = types.Display() 3951 3952 # Process the attributes: 3953 obj.href = reader.get_attribute('href') 3954 3955 # Discard the start tag: 3956 empty = reader.empty_element() 3957 reader.read() 3958 if empty: 3959 return obj 3960 3961 # Process the inner elements: 3962 links = [] 3963 while reader.forward(): 3964 tag = reader.node_name() 3965 if tag == 'address': 3966 obj.address = Reader.read_string(reader) 3967 elif tag == 'allow_override': 3968 obj.allow_override = Reader.read_boolean(reader) 3969 elif tag == 'certificate': 3970 obj.certificate = CertificateReader.read_one(reader) 3971 elif tag == 'copy_paste_enabled': 3972 obj.copy_paste_enabled = Reader.read_boolean(reader) 3973 elif tag == 'disconnect_action': 3974 obj.disconnect_action = Reader.read_string(reader) 3975 elif tag == 'disconnect_action_delay': 3976 obj.disconnect_action_delay = Reader.read_integer(reader) 3977 elif tag == 'file_transfer_enabled': 3978 obj.file_transfer_enabled = Reader.read_boolean(reader) 3979 elif tag == 'keyboard_layout': 3980 obj.keyboard_layout = Reader.read_string(reader) 3981 elif tag == 'monitors': 3982 obj.monitors = Reader.read_integer(reader) 3983 elif tag == 'port': 3984 obj.port = Reader.read_integer(reader) 3985 elif tag == 'proxy': 3986 obj.proxy = Reader.read_string(reader) 3987 elif tag == 'secure_port': 3988 obj.secure_port = Reader.read_integer(reader) 3989 elif tag == 'single_qxl_pci': 3990 obj.single_qxl_pci = Reader.read_boolean(reader) 3991 elif tag == 'smartcard_enabled': 3992 obj.smartcard_enabled = Reader.read_boolean(reader) 3993 elif tag == 'type': 3994 obj.type = Reader.read_enum(types.DisplayType, reader) 3995 else: 3996 reader.next_element() 3997 for link in links: 3998 DisplayReader._process_link(link, obj) 3999 4000 # Discard the end tag: 4001 reader.read() 4002 4003 return obj 4004 4005 @staticmethod 4006 def read_many(reader): 4007 # Do nothing if there aren't more tags: 4008 objs = List() 4009 if not reader.forward(): 4010 return objs 4011 4012 # Process the attributes: 4013 objs.href = reader.get_attribute('href') 4014 4015 # Discard the start tag: 4016 empty = reader.empty_element() 4017 reader.read() 4018 if empty: 4019 return objs 4020 4021 # Process the inner elements: 4022 while reader.forward(): 4023 objs.append(DisplayReader.read_one(reader)) 4024 4025 # Discard the end tag: 4026 reader.read() 4027 4028 return objs 4029 4030 4031class DnsReader(Reader): 4032 4033 def __init__(self): 4034 super(DnsReader, self).__init__() 4035 4036 @staticmethod 4037 def read_one(reader): 4038 # Do nothing if there aren't more tags: 4039 if not reader.forward(): 4040 return None 4041 4042 # Create the object: 4043 obj = types.Dns() 4044 4045 # Process the attributes: 4046 obj.href = reader.get_attribute('href') 4047 4048 # Discard the start tag: 4049 empty = reader.empty_element() 4050 reader.read() 4051 if empty: 4052 return obj 4053 4054 # Process the inner elements: 4055 links = [] 4056 while reader.forward(): 4057 tag = reader.node_name() 4058 if tag == 'search_domains': 4059 obj.search_domains = HostReader.read_many(reader) 4060 elif tag == 'servers': 4061 obj.servers = HostReader.read_many(reader) 4062 else: 4063 reader.next_element() 4064 for link in links: 4065 DnsReader._process_link(link, obj) 4066 4067 # Discard the end tag: 4068 reader.read() 4069 4070 return obj 4071 4072 @staticmethod 4073 def read_many(reader): 4074 # Do nothing if there aren't more tags: 4075 objs = List() 4076 if not reader.forward(): 4077 return objs 4078 4079 # Process the attributes: 4080 objs.href = reader.get_attribute('href') 4081 4082 # Discard the start tag: 4083 empty = reader.empty_element() 4084 reader.read() 4085 if empty: 4086 return objs 4087 4088 # Process the inner elements: 4089 while reader.forward(): 4090 objs.append(DnsReader.read_one(reader)) 4091 4092 # Discard the end tag: 4093 reader.read() 4094 4095 return objs 4096 4097 4098class DnsResolverConfigurationReader(Reader): 4099 4100 def __init__(self): 4101 super(DnsResolverConfigurationReader, self).__init__() 4102 4103 @staticmethod 4104 def read_one(reader): 4105 # Do nothing if there aren't more tags: 4106 if not reader.forward(): 4107 return None 4108 4109 # Create the object: 4110 obj = types.DnsResolverConfiguration() 4111 4112 # Process the attributes: 4113 obj.href = reader.get_attribute('href') 4114 4115 # Discard the start tag: 4116 empty = reader.empty_element() 4117 reader.read() 4118 if empty: 4119 return obj 4120 4121 # Process the inner elements: 4122 links = [] 4123 while reader.forward(): 4124 tag = reader.node_name() 4125 if tag == 'name_servers': 4126 obj.name_servers = Reader.read_strings(reader) 4127 else: 4128 reader.next_element() 4129 for link in links: 4130 DnsResolverConfigurationReader._process_link(link, obj) 4131 4132 # Discard the end tag: 4133 reader.read() 4134 4135 return obj 4136 4137 @staticmethod 4138 def read_many(reader): 4139 # Do nothing if there aren't more tags: 4140 objs = List() 4141 if not reader.forward(): 4142 return objs 4143 4144 # Process the attributes: 4145 objs.href = reader.get_attribute('href') 4146 4147 # Discard the start tag: 4148 empty = reader.empty_element() 4149 reader.read() 4150 if empty: 4151 return objs 4152 4153 # Process the inner elements: 4154 while reader.forward(): 4155 objs.append(DnsResolverConfigurationReader.read_one(reader)) 4156 4157 # Discard the end tag: 4158 reader.read() 4159 4160 return objs 4161 4162 4163class DomainReader(Reader): 4164 4165 def __init__(self): 4166 super(DomainReader, self).__init__() 4167 4168 @staticmethod 4169 def read_one(reader): 4170 # Do nothing if there aren't more tags: 4171 if not reader.forward(): 4172 return None 4173 4174 # Create the object: 4175 obj = types.Domain() 4176 4177 # Process the attributes: 4178 obj.href = reader.get_attribute('href') 4179 value = reader.get_attribute('id') 4180 if value is not None: 4181 obj.id = value 4182 4183 # Discard the start tag: 4184 empty = reader.empty_element() 4185 reader.read() 4186 if empty: 4187 return obj 4188 4189 # Process the inner elements: 4190 links = [] 4191 while reader.forward(): 4192 tag = reader.node_name() 4193 if tag == 'comment': 4194 obj.comment = Reader.read_string(reader) 4195 elif tag == 'description': 4196 obj.description = Reader.read_string(reader) 4197 elif tag == 'groups': 4198 obj.groups = GroupReader.read_many(reader) 4199 elif tag == 'name': 4200 obj.name = Reader.read_string(reader) 4201 elif tag == 'user': 4202 obj.user = UserReader.read_one(reader) 4203 elif tag == 'users': 4204 obj.users = UserReader.read_many(reader) 4205 elif tag == 'link': 4206 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 4207 reader.next_element() 4208 else: 4209 reader.next_element() 4210 for link in links: 4211 DomainReader._process_link(link, obj) 4212 4213 # Discard the end tag: 4214 reader.read() 4215 4216 return obj 4217 4218 @staticmethod 4219 def read_many(reader): 4220 # Do nothing if there aren't more tags: 4221 objs = List() 4222 if not reader.forward(): 4223 return objs 4224 4225 # Process the attributes: 4226 objs.href = reader.get_attribute('href') 4227 4228 # Discard the start tag: 4229 empty = reader.empty_element() 4230 reader.read() 4231 if empty: 4232 return objs 4233 4234 # Process the inner elements: 4235 while reader.forward(): 4236 objs.append(DomainReader.read_one(reader)) 4237 4238 # Discard the end tag: 4239 reader.read() 4240 4241 return objs 4242 4243 @staticmethod 4244 def _process_link(link, obj): 4245 # Process the attributes: 4246 rel = link[0] 4247 href = link[1] 4248 if href and rel: 4249 if rel == "groups": 4250 if obj.groups is not None: 4251 obj.groups.href = href 4252 else: 4253 obj.groups = List(href) 4254 elif rel == "users": 4255 if obj.users is not None: 4256 obj.users.href = href 4257 else: 4258 obj.users = List(href) 4259 4260 4261class DynamicCpuReader(Reader): 4262 4263 def __init__(self): 4264 super(DynamicCpuReader, self).__init__() 4265 4266 @staticmethod 4267 def read_one(reader): 4268 # Do nothing if there aren't more tags: 4269 if not reader.forward(): 4270 return None 4271 4272 # Create the object: 4273 obj = types.DynamicCpu() 4274 4275 # Process the attributes: 4276 obj.href = reader.get_attribute('href') 4277 4278 # Discard the start tag: 4279 empty = reader.empty_element() 4280 reader.read() 4281 if empty: 4282 return obj 4283 4284 # Process the inner elements: 4285 links = [] 4286 while reader.forward(): 4287 tag = reader.node_name() 4288 if tag == 'cpu_tune': 4289 obj.cpu_tune = CpuTuneReader.read_one(reader) 4290 elif tag == 'topology': 4291 obj.topology = CpuTopologyReader.read_one(reader) 4292 else: 4293 reader.next_element() 4294 for link in links: 4295 DynamicCpuReader._process_link(link, obj) 4296 4297 # Discard the end tag: 4298 reader.read() 4299 4300 return obj 4301 4302 @staticmethod 4303 def read_many(reader): 4304 # Do nothing if there aren't more tags: 4305 objs = List() 4306 if not reader.forward(): 4307 return objs 4308 4309 # Process the attributes: 4310 objs.href = reader.get_attribute('href') 4311 4312 # Discard the start tag: 4313 empty = reader.empty_element() 4314 reader.read() 4315 if empty: 4316 return objs 4317 4318 # Process the inner elements: 4319 while reader.forward(): 4320 objs.append(DynamicCpuReader.read_one(reader)) 4321 4322 # Discard the end tag: 4323 reader.read() 4324 4325 return objs 4326 4327 4328class EntityProfileDetailReader(Reader): 4329 4330 def __init__(self): 4331 super(EntityProfileDetailReader, self).__init__() 4332 4333 @staticmethod 4334 def read_one(reader): 4335 # Do nothing if there aren't more tags: 4336 if not reader.forward(): 4337 return None 4338 4339 # Create the object: 4340 obj = types.EntityProfileDetail() 4341 4342 # Process the attributes: 4343 obj.href = reader.get_attribute('href') 4344 4345 # Discard the start tag: 4346 empty = reader.empty_element() 4347 reader.read() 4348 if empty: 4349 return obj 4350 4351 # Process the inner elements: 4352 links = [] 4353 while reader.forward(): 4354 tag = reader.node_name() 4355 if tag == 'profile_details': 4356 obj.profile_details = ProfileDetailReader.read_many(reader) 4357 else: 4358 reader.next_element() 4359 for link in links: 4360 EntityProfileDetailReader._process_link(link, obj) 4361 4362 # Discard the end tag: 4363 reader.read() 4364 4365 return obj 4366 4367 @staticmethod 4368 def read_many(reader): 4369 # Do nothing if there aren't more tags: 4370 objs = List() 4371 if not reader.forward(): 4372 return objs 4373 4374 # Process the attributes: 4375 objs.href = reader.get_attribute('href') 4376 4377 # Discard the start tag: 4378 empty = reader.empty_element() 4379 reader.read() 4380 if empty: 4381 return objs 4382 4383 # Process the inner elements: 4384 while reader.forward(): 4385 objs.append(EntityProfileDetailReader.read_one(reader)) 4386 4387 # Discard the end tag: 4388 reader.read() 4389 4390 return objs 4391 4392 4393class ErrorHandlingReader(Reader): 4394 4395 def __init__(self): 4396 super(ErrorHandlingReader, self).__init__() 4397 4398 @staticmethod 4399 def read_one(reader): 4400 # Do nothing if there aren't more tags: 4401 if not reader.forward(): 4402 return None 4403 4404 # Create the object: 4405 obj = types.ErrorHandling() 4406 4407 # Process the attributes: 4408 obj.href = reader.get_attribute('href') 4409 4410 # Discard the start tag: 4411 empty = reader.empty_element() 4412 reader.read() 4413 if empty: 4414 return obj 4415 4416 # Process the inner elements: 4417 links = [] 4418 while reader.forward(): 4419 tag = reader.node_name() 4420 if tag == 'on_error': 4421 obj.on_error = Reader.read_enum(types.MigrateOnError, reader) 4422 else: 4423 reader.next_element() 4424 for link in links: 4425 ErrorHandlingReader._process_link(link, obj) 4426 4427 # Discard the end tag: 4428 reader.read() 4429 4430 return obj 4431 4432 @staticmethod 4433 def read_many(reader): 4434 # Do nothing if there aren't more tags: 4435 objs = List() 4436 if not reader.forward(): 4437 return objs 4438 4439 # Process the attributes: 4440 objs.href = reader.get_attribute('href') 4441 4442 # Discard the start tag: 4443 empty = reader.empty_element() 4444 reader.read() 4445 if empty: 4446 return objs 4447 4448 # Process the inner elements: 4449 while reader.forward(): 4450 objs.append(ErrorHandlingReader.read_one(reader)) 4451 4452 # Discard the end tag: 4453 reader.read() 4454 4455 return objs 4456 4457 4458class EventReader(Reader): 4459 4460 def __init__(self): 4461 super(EventReader, self).__init__() 4462 4463 @staticmethod 4464 def read_one(reader): 4465 # Do nothing if there aren't more tags: 4466 if not reader.forward(): 4467 return None 4468 4469 # Create the object: 4470 obj = types.Event() 4471 4472 # Process the attributes: 4473 obj.href = reader.get_attribute('href') 4474 value = reader.get_attribute('id') 4475 if value is not None: 4476 obj.id = value 4477 4478 # Discard the start tag: 4479 empty = reader.empty_element() 4480 reader.read() 4481 if empty: 4482 return obj 4483 4484 # Process the inner elements: 4485 links = [] 4486 while reader.forward(): 4487 tag = reader.node_name() 4488 if tag == 'cluster': 4489 obj.cluster = ClusterReader.read_one(reader) 4490 elif tag == 'code': 4491 obj.code = Reader.read_integer(reader) 4492 elif tag == 'comment': 4493 obj.comment = Reader.read_string(reader) 4494 elif tag == 'correlation_id': 4495 obj.correlation_id = Reader.read_string(reader) 4496 elif tag == 'custom_data': 4497 obj.custom_data = Reader.read_string(reader) 4498 elif tag == 'custom_id': 4499 obj.custom_id = Reader.read_integer(reader) 4500 elif tag == 'data_center': 4501 obj.data_center = DataCenterReader.read_one(reader) 4502 elif tag == 'description': 4503 obj.description = Reader.read_string(reader) 4504 elif tag == 'flood_rate': 4505 obj.flood_rate = Reader.read_integer(reader) 4506 elif tag == 'host': 4507 obj.host = HostReader.read_one(reader) 4508 elif tag == 'index': 4509 obj.index = Reader.read_integer(reader) 4510 elif tag == 'log_on_host': 4511 obj.log_on_host = Reader.read_boolean(reader) 4512 elif tag == 'name': 4513 obj.name = Reader.read_string(reader) 4514 elif tag == 'origin': 4515 obj.origin = Reader.read_string(reader) 4516 elif tag == 'severity': 4517 obj.severity = Reader.read_enum(types.LogSeverity, reader) 4518 elif tag == 'storage_domain': 4519 obj.storage_domain = StorageDomainReader.read_one(reader) 4520 elif tag == 'template': 4521 obj.template = TemplateReader.read_one(reader) 4522 elif tag == 'time': 4523 obj.time = Reader.read_date(reader) 4524 elif tag == 'user': 4525 obj.user = UserReader.read_one(reader) 4526 elif tag == 'vm': 4527 obj.vm = VmReader.read_one(reader) 4528 else: 4529 reader.next_element() 4530 for link in links: 4531 EventReader._process_link(link, obj) 4532 4533 # Discard the end tag: 4534 reader.read() 4535 4536 return obj 4537 4538 @staticmethod 4539 def read_many(reader): 4540 # Do nothing if there aren't more tags: 4541 objs = List() 4542 if not reader.forward(): 4543 return objs 4544 4545 # Process the attributes: 4546 objs.href = reader.get_attribute('href') 4547 4548 # Discard the start tag: 4549 empty = reader.empty_element() 4550 reader.read() 4551 if empty: 4552 return objs 4553 4554 # Process the inner elements: 4555 while reader.forward(): 4556 objs.append(EventReader.read_one(reader)) 4557 4558 # Discard the end tag: 4559 reader.read() 4560 4561 return objs 4562 4563 4564class EventSubscriptionReader(Reader): 4565 4566 def __init__(self): 4567 super(EventSubscriptionReader, self).__init__() 4568 4569 @staticmethod 4570 def read_one(reader): 4571 # Do nothing if there aren't more tags: 4572 if not reader.forward(): 4573 return None 4574 4575 # Create the object: 4576 obj = types.EventSubscription() 4577 4578 # Process the attributes: 4579 obj.href = reader.get_attribute('href') 4580 value = reader.get_attribute('id') 4581 if value is not None: 4582 obj.id = value 4583 4584 # Discard the start tag: 4585 empty = reader.empty_element() 4586 reader.read() 4587 if empty: 4588 return obj 4589 4590 # Process the inner elements: 4591 links = [] 4592 while reader.forward(): 4593 tag = reader.node_name() 4594 if tag == 'address': 4595 obj.address = Reader.read_string(reader) 4596 elif tag == 'comment': 4597 obj.comment = Reader.read_string(reader) 4598 elif tag == 'description': 4599 obj.description = Reader.read_string(reader) 4600 elif tag == 'event': 4601 obj.event = Reader.read_enum(types.NotifiableEvent, reader) 4602 elif tag == 'name': 4603 obj.name = Reader.read_string(reader) 4604 elif tag == 'notification_method': 4605 obj.notification_method = Reader.read_enum(types.NotificationMethod, reader) 4606 elif tag == 'user': 4607 obj.user = UserReader.read_one(reader) 4608 else: 4609 reader.next_element() 4610 for link in links: 4611 EventSubscriptionReader._process_link(link, obj) 4612 4613 # Discard the end tag: 4614 reader.read() 4615 4616 return obj 4617 4618 @staticmethod 4619 def read_many(reader): 4620 # Do nothing if there aren't more tags: 4621 objs = List() 4622 if not reader.forward(): 4623 return objs 4624 4625 # Process the attributes: 4626 objs.href = reader.get_attribute('href') 4627 4628 # Discard the start tag: 4629 empty = reader.empty_element() 4630 reader.read() 4631 if empty: 4632 return objs 4633 4634 # Process the inner elements: 4635 while reader.forward(): 4636 objs.append(EventSubscriptionReader.read_one(reader)) 4637 4638 # Discard the end tag: 4639 reader.read() 4640 4641 return objs 4642 4643 4644class ExternalComputeResourceReader(Reader): 4645 4646 def __init__(self): 4647 super(ExternalComputeResourceReader, self).__init__() 4648 4649 @staticmethod 4650 def read_one(reader): 4651 # Do nothing if there aren't more tags: 4652 if not reader.forward(): 4653 return None 4654 4655 # Create the object: 4656 obj = types.ExternalComputeResource() 4657 4658 # Process the attributes: 4659 obj.href = reader.get_attribute('href') 4660 value = reader.get_attribute('id') 4661 if value is not None: 4662 obj.id = value 4663 4664 # Discard the start tag: 4665 empty = reader.empty_element() 4666 reader.read() 4667 if empty: 4668 return obj 4669 4670 # Process the inner elements: 4671 links = [] 4672 while reader.forward(): 4673 tag = reader.node_name() 4674 if tag == 'comment': 4675 obj.comment = Reader.read_string(reader) 4676 elif tag == 'description': 4677 obj.description = Reader.read_string(reader) 4678 elif tag == 'external_host_provider': 4679 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4680 elif tag == 'name': 4681 obj.name = Reader.read_string(reader) 4682 elif tag == 'provider': 4683 obj.provider = Reader.read_string(reader) 4684 elif tag == 'url': 4685 obj.url = Reader.read_string(reader) 4686 elif tag == 'user': 4687 obj.user = Reader.read_string(reader) 4688 else: 4689 reader.next_element() 4690 for link in links: 4691 ExternalComputeResourceReader._process_link(link, obj) 4692 4693 # Discard the end tag: 4694 reader.read() 4695 4696 return obj 4697 4698 @staticmethod 4699 def read_many(reader): 4700 # Do nothing if there aren't more tags: 4701 objs = List() 4702 if not reader.forward(): 4703 return objs 4704 4705 # Process the attributes: 4706 objs.href = reader.get_attribute('href') 4707 4708 # Discard the start tag: 4709 empty = reader.empty_element() 4710 reader.read() 4711 if empty: 4712 return objs 4713 4714 # Process the inner elements: 4715 while reader.forward(): 4716 objs.append(ExternalComputeResourceReader.read_one(reader)) 4717 4718 # Discard the end tag: 4719 reader.read() 4720 4721 return objs 4722 4723 4724class ExternalDiscoveredHostReader(Reader): 4725 4726 def __init__(self): 4727 super(ExternalDiscoveredHostReader, self).__init__() 4728 4729 @staticmethod 4730 def read_one(reader): 4731 # Do nothing if there aren't more tags: 4732 if not reader.forward(): 4733 return None 4734 4735 # Create the object: 4736 obj = types.ExternalDiscoveredHost() 4737 4738 # Process the attributes: 4739 obj.href = reader.get_attribute('href') 4740 value = reader.get_attribute('id') 4741 if value is not None: 4742 obj.id = value 4743 4744 # Discard the start tag: 4745 empty = reader.empty_element() 4746 reader.read() 4747 if empty: 4748 return obj 4749 4750 # Process the inner elements: 4751 links = [] 4752 while reader.forward(): 4753 tag = reader.node_name() 4754 if tag == 'comment': 4755 obj.comment = Reader.read_string(reader) 4756 elif tag == 'description': 4757 obj.description = Reader.read_string(reader) 4758 elif tag == 'external_host_provider': 4759 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4760 elif tag == 'ip': 4761 obj.ip = Reader.read_string(reader) 4762 elif tag == 'last_report': 4763 obj.last_report = Reader.read_string(reader) 4764 elif tag == 'mac': 4765 obj.mac = Reader.read_string(reader) 4766 elif tag == 'name': 4767 obj.name = Reader.read_string(reader) 4768 elif tag == 'subnet_name': 4769 obj.subnet_name = Reader.read_string(reader) 4770 else: 4771 reader.next_element() 4772 for link in links: 4773 ExternalDiscoveredHostReader._process_link(link, obj) 4774 4775 # Discard the end tag: 4776 reader.read() 4777 4778 return obj 4779 4780 @staticmethod 4781 def read_many(reader): 4782 # Do nothing if there aren't more tags: 4783 objs = List() 4784 if not reader.forward(): 4785 return objs 4786 4787 # Process the attributes: 4788 objs.href = reader.get_attribute('href') 4789 4790 # Discard the start tag: 4791 empty = reader.empty_element() 4792 reader.read() 4793 if empty: 4794 return objs 4795 4796 # Process the inner elements: 4797 while reader.forward(): 4798 objs.append(ExternalDiscoveredHostReader.read_one(reader)) 4799 4800 # Discard the end tag: 4801 reader.read() 4802 4803 return objs 4804 4805 4806class ExternalHostReader(Reader): 4807 4808 def __init__(self): 4809 super(ExternalHostReader, self).__init__() 4810 4811 @staticmethod 4812 def read_one(reader): 4813 # Do nothing if there aren't more tags: 4814 if not reader.forward(): 4815 return None 4816 4817 # Create the object: 4818 obj = types.ExternalHost() 4819 4820 # Process the attributes: 4821 obj.href = reader.get_attribute('href') 4822 value = reader.get_attribute('id') 4823 if value is not None: 4824 obj.id = value 4825 4826 # Discard the start tag: 4827 empty = reader.empty_element() 4828 reader.read() 4829 if empty: 4830 return obj 4831 4832 # Process the inner elements: 4833 links = [] 4834 while reader.forward(): 4835 tag = reader.node_name() 4836 if tag == 'address': 4837 obj.address = Reader.read_string(reader) 4838 elif tag == 'comment': 4839 obj.comment = Reader.read_string(reader) 4840 elif tag == 'description': 4841 obj.description = Reader.read_string(reader) 4842 elif tag == 'external_host_provider': 4843 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4844 elif tag == 'name': 4845 obj.name = Reader.read_string(reader) 4846 else: 4847 reader.next_element() 4848 for link in links: 4849 ExternalHostReader._process_link(link, obj) 4850 4851 # Discard the end tag: 4852 reader.read() 4853 4854 return obj 4855 4856 @staticmethod 4857 def read_many(reader): 4858 # Do nothing if there aren't more tags: 4859 objs = List() 4860 if not reader.forward(): 4861 return objs 4862 4863 # Process the attributes: 4864 objs.href = reader.get_attribute('href') 4865 4866 # Discard the start tag: 4867 empty = reader.empty_element() 4868 reader.read() 4869 if empty: 4870 return objs 4871 4872 # Process the inner elements: 4873 while reader.forward(): 4874 objs.append(ExternalHostReader.read_one(reader)) 4875 4876 # Discard the end tag: 4877 reader.read() 4878 4879 return objs 4880 4881 4882class ExternalHostGroupReader(Reader): 4883 4884 def __init__(self): 4885 super(ExternalHostGroupReader, self).__init__() 4886 4887 @staticmethod 4888 def read_one(reader): 4889 # Do nothing if there aren't more tags: 4890 if not reader.forward(): 4891 return None 4892 4893 # Create the object: 4894 obj = types.ExternalHostGroup() 4895 4896 # Process the attributes: 4897 obj.href = reader.get_attribute('href') 4898 value = reader.get_attribute('id') 4899 if value is not None: 4900 obj.id = value 4901 4902 # Discard the start tag: 4903 empty = reader.empty_element() 4904 reader.read() 4905 if empty: 4906 return obj 4907 4908 # Process the inner elements: 4909 links = [] 4910 while reader.forward(): 4911 tag = reader.node_name() 4912 if tag == 'architecture_name': 4913 obj.architecture_name = Reader.read_string(reader) 4914 elif tag == 'comment': 4915 obj.comment = Reader.read_string(reader) 4916 elif tag == 'description': 4917 obj.description = Reader.read_string(reader) 4918 elif tag == 'domain_name': 4919 obj.domain_name = Reader.read_string(reader) 4920 elif tag == 'external_host_provider': 4921 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4922 elif tag == 'name': 4923 obj.name = Reader.read_string(reader) 4924 elif tag == 'operating_system_name': 4925 obj.operating_system_name = Reader.read_string(reader) 4926 elif tag == 'subnet_name': 4927 obj.subnet_name = Reader.read_string(reader) 4928 else: 4929 reader.next_element() 4930 for link in links: 4931 ExternalHostGroupReader._process_link(link, obj) 4932 4933 # Discard the end tag: 4934 reader.read() 4935 4936 return obj 4937 4938 @staticmethod 4939 def read_many(reader): 4940 # Do nothing if there aren't more tags: 4941 objs = List() 4942 if not reader.forward(): 4943 return objs 4944 4945 # Process the attributes: 4946 objs.href = reader.get_attribute('href') 4947 4948 # Discard the start tag: 4949 empty = reader.empty_element() 4950 reader.read() 4951 if empty: 4952 return objs 4953 4954 # Process the inner elements: 4955 while reader.forward(): 4956 objs.append(ExternalHostGroupReader.read_one(reader)) 4957 4958 # Discard the end tag: 4959 reader.read() 4960 4961 return objs 4962 4963 4964class ExternalHostProviderReader(Reader): 4965 4966 def __init__(self): 4967 super(ExternalHostProviderReader, self).__init__() 4968 4969 @staticmethod 4970 def read_one(reader): 4971 # Do nothing if there aren't more tags: 4972 if not reader.forward(): 4973 return None 4974 4975 # Create the object: 4976 obj = types.ExternalHostProvider() 4977 4978 # Process the attributes: 4979 obj.href = reader.get_attribute('href') 4980 value = reader.get_attribute('id') 4981 if value is not None: 4982 obj.id = value 4983 4984 # Discard the start tag: 4985 empty = reader.empty_element() 4986 reader.read() 4987 if empty: 4988 return obj 4989 4990 # Process the inner elements: 4991 links = [] 4992 while reader.forward(): 4993 tag = reader.node_name() 4994 if tag == 'authentication_url': 4995 obj.authentication_url = Reader.read_string(reader) 4996 elif tag == 'certificates': 4997 obj.certificates = CertificateReader.read_many(reader) 4998 elif tag == 'comment': 4999 obj.comment = Reader.read_string(reader) 5000 elif tag == 'compute_resources': 5001 obj.compute_resources = ExternalComputeResourceReader.read_many(reader) 5002 elif tag == 'description': 5003 obj.description = Reader.read_string(reader) 5004 elif tag == 'discovered_hosts': 5005 obj.discovered_hosts = ExternalDiscoveredHostReader.read_many(reader) 5006 elif tag == 'host_groups': 5007 obj.host_groups = ExternalHostGroupReader.read_many(reader) 5008 elif tag == 'hosts': 5009 obj.hosts = HostReader.read_many(reader) 5010 elif tag == 'name': 5011 obj.name = Reader.read_string(reader) 5012 elif tag == 'password': 5013 obj.password = Reader.read_string(reader) 5014 elif tag == 'properties': 5015 obj.properties = PropertyReader.read_many(reader) 5016 elif tag == 'requires_authentication': 5017 obj.requires_authentication = Reader.read_boolean(reader) 5018 elif tag == 'url': 5019 obj.url = Reader.read_string(reader) 5020 elif tag == 'username': 5021 obj.username = Reader.read_string(reader) 5022 elif tag == 'link': 5023 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5024 reader.next_element() 5025 else: 5026 reader.next_element() 5027 for link in links: 5028 ExternalHostProviderReader._process_link(link, obj) 5029 5030 # Discard the end tag: 5031 reader.read() 5032 5033 return obj 5034 5035 @staticmethod 5036 def read_many(reader): 5037 # Do nothing if there aren't more tags: 5038 objs = List() 5039 if not reader.forward(): 5040 return objs 5041 5042 # Process the attributes: 5043 objs.href = reader.get_attribute('href') 5044 5045 # Discard the start tag: 5046 empty = reader.empty_element() 5047 reader.read() 5048 if empty: 5049 return objs 5050 5051 # Process the inner elements: 5052 while reader.forward(): 5053 objs.append(ExternalHostProviderReader.read_one(reader)) 5054 5055 # Discard the end tag: 5056 reader.read() 5057 5058 return objs 5059 5060 @staticmethod 5061 def _process_link(link, obj): 5062 # Process the attributes: 5063 rel = link[0] 5064 href = link[1] 5065 if href and rel: 5066 if rel == "certificates": 5067 if obj.certificates is not None: 5068 obj.certificates.href = href 5069 else: 5070 obj.certificates = List(href) 5071 elif rel == "computeresources": 5072 if obj.compute_resources is not None: 5073 obj.compute_resources.href = href 5074 else: 5075 obj.compute_resources = List(href) 5076 elif rel == "discoveredhosts": 5077 if obj.discovered_hosts is not None: 5078 obj.discovered_hosts.href = href 5079 else: 5080 obj.discovered_hosts = List(href) 5081 elif rel == "hostgroups": 5082 if obj.host_groups is not None: 5083 obj.host_groups.href = href 5084 else: 5085 obj.host_groups = List(href) 5086 elif rel == "hosts": 5087 if obj.hosts is not None: 5088 obj.hosts.href = href 5089 else: 5090 obj.hosts = List(href) 5091 5092 5093class ExternalNetworkProviderConfigurationReader(Reader): 5094 5095 def __init__(self): 5096 super(ExternalNetworkProviderConfigurationReader, self).__init__() 5097 5098 @staticmethod 5099 def read_one(reader): 5100 # Do nothing if there aren't more tags: 5101 if not reader.forward(): 5102 return None 5103 5104 # Create the object: 5105 obj = types.ExternalNetworkProviderConfiguration() 5106 5107 # Process the attributes: 5108 obj.href = reader.get_attribute('href') 5109 value = reader.get_attribute('id') 5110 if value is not None: 5111 obj.id = value 5112 5113 # Discard the start tag: 5114 empty = reader.empty_element() 5115 reader.read() 5116 if empty: 5117 return obj 5118 5119 # Process the inner elements: 5120 links = [] 5121 while reader.forward(): 5122 tag = reader.node_name() 5123 if tag == 'comment': 5124 obj.comment = Reader.read_string(reader) 5125 elif tag == 'description': 5126 obj.description = Reader.read_string(reader) 5127 elif tag == 'external_network_provider': 5128 obj.external_network_provider = ExternalProviderReader.read_one(reader) 5129 elif tag == 'host': 5130 obj.host = HostReader.read_one(reader) 5131 elif tag == 'name': 5132 obj.name = Reader.read_string(reader) 5133 else: 5134 reader.next_element() 5135 for link in links: 5136 ExternalNetworkProviderConfigurationReader._process_link(link, obj) 5137 5138 # Discard the end tag: 5139 reader.read() 5140 5141 return obj 5142 5143 @staticmethod 5144 def read_many(reader): 5145 # Do nothing if there aren't more tags: 5146 objs = List() 5147 if not reader.forward(): 5148 return objs 5149 5150 # Process the attributes: 5151 objs.href = reader.get_attribute('href') 5152 5153 # Discard the start tag: 5154 empty = reader.empty_element() 5155 reader.read() 5156 if empty: 5157 return objs 5158 5159 # Process the inner elements: 5160 while reader.forward(): 5161 objs.append(ExternalNetworkProviderConfigurationReader.read_one(reader)) 5162 5163 # Discard the end tag: 5164 reader.read() 5165 5166 return objs 5167 5168 5169class ExternalProviderReader(Reader): 5170 5171 def __init__(self): 5172 super(ExternalProviderReader, self).__init__() 5173 5174 @staticmethod 5175 def read_one(reader): 5176 # Do nothing if there aren't more tags: 5177 if not reader.forward(): 5178 return None 5179 5180 # Create the object: 5181 obj = types.ExternalProvider() 5182 5183 # Process the attributes: 5184 obj.href = reader.get_attribute('href') 5185 value = reader.get_attribute('id') 5186 if value is not None: 5187 obj.id = value 5188 5189 # Discard the start tag: 5190 empty = reader.empty_element() 5191 reader.read() 5192 if empty: 5193 return obj 5194 5195 # Process the inner elements: 5196 links = [] 5197 while reader.forward(): 5198 tag = reader.node_name() 5199 if tag == 'authentication_url': 5200 obj.authentication_url = Reader.read_string(reader) 5201 elif tag == 'comment': 5202 obj.comment = Reader.read_string(reader) 5203 elif tag == 'description': 5204 obj.description = Reader.read_string(reader) 5205 elif tag == 'name': 5206 obj.name = Reader.read_string(reader) 5207 elif tag == 'password': 5208 obj.password = Reader.read_string(reader) 5209 elif tag == 'properties': 5210 obj.properties = PropertyReader.read_many(reader) 5211 elif tag == 'requires_authentication': 5212 obj.requires_authentication = Reader.read_boolean(reader) 5213 elif tag == 'url': 5214 obj.url = Reader.read_string(reader) 5215 elif tag == 'username': 5216 obj.username = Reader.read_string(reader) 5217 else: 5218 reader.next_element() 5219 for link in links: 5220 ExternalProviderReader._process_link(link, obj) 5221 5222 # Discard the end tag: 5223 reader.read() 5224 5225 return obj 5226 5227 @staticmethod 5228 def read_many(reader): 5229 # Do nothing if there aren't more tags: 5230 objs = List() 5231 if not reader.forward(): 5232 return objs 5233 5234 # Process the attributes: 5235 objs.href = reader.get_attribute('href') 5236 5237 # Discard the start tag: 5238 empty = reader.empty_element() 5239 reader.read() 5240 if empty: 5241 return objs 5242 5243 # Process the inner elements: 5244 while reader.forward(): 5245 objs.append(ExternalProviderReader.read_one(reader)) 5246 5247 # Discard the end tag: 5248 reader.read() 5249 5250 return objs 5251 5252 5253class ExternalTemplateImportReader(Reader): 5254 5255 def __init__(self): 5256 super(ExternalTemplateImportReader, self).__init__() 5257 5258 @staticmethod 5259 def read_one(reader): 5260 # Do nothing if there aren't more tags: 5261 if not reader.forward(): 5262 return None 5263 5264 # Create the object: 5265 obj = types.ExternalTemplateImport() 5266 5267 # Process the attributes: 5268 obj.href = reader.get_attribute('href') 5269 5270 # Discard the start tag: 5271 empty = reader.empty_element() 5272 reader.read() 5273 if empty: 5274 return obj 5275 5276 # Process the inner elements: 5277 links = [] 5278 while reader.forward(): 5279 tag = reader.node_name() 5280 if tag == 'clone': 5281 obj.clone = Reader.read_boolean(reader) 5282 elif tag == 'cluster': 5283 obj.cluster = ClusterReader.read_one(reader) 5284 elif tag == 'cpu_profile': 5285 obj.cpu_profile = CpuProfileReader.read_one(reader) 5286 elif tag == 'host': 5287 obj.host = HostReader.read_one(reader) 5288 elif tag == 'quota': 5289 obj.quota = QuotaReader.read_one(reader) 5290 elif tag == 'storage_domain': 5291 obj.storage_domain = StorageDomainReader.read_one(reader) 5292 elif tag == 'template': 5293 obj.template = TemplateReader.read_one(reader) 5294 elif tag == 'url': 5295 obj.url = Reader.read_string(reader) 5296 else: 5297 reader.next_element() 5298 for link in links: 5299 ExternalTemplateImportReader._process_link(link, obj) 5300 5301 # Discard the end tag: 5302 reader.read() 5303 5304 return obj 5305 5306 @staticmethod 5307 def read_many(reader): 5308 # Do nothing if there aren't more tags: 5309 objs = List() 5310 if not reader.forward(): 5311 return objs 5312 5313 # Process the attributes: 5314 objs.href = reader.get_attribute('href') 5315 5316 # Discard the start tag: 5317 empty = reader.empty_element() 5318 reader.read() 5319 if empty: 5320 return objs 5321 5322 # Process the inner elements: 5323 while reader.forward(): 5324 objs.append(ExternalTemplateImportReader.read_one(reader)) 5325 5326 # Discard the end tag: 5327 reader.read() 5328 5329 return objs 5330 5331 5332class ExternalVmImportReader(Reader): 5333 5334 def __init__(self): 5335 super(ExternalVmImportReader, self).__init__() 5336 5337 @staticmethod 5338 def read_one(reader): 5339 # Do nothing if there aren't more tags: 5340 if not reader.forward(): 5341 return None 5342 5343 # Create the object: 5344 obj = types.ExternalVmImport() 5345 5346 # Process the attributes: 5347 obj.href = reader.get_attribute('href') 5348 5349 # Discard the start tag: 5350 empty = reader.empty_element() 5351 reader.read() 5352 if empty: 5353 return obj 5354 5355 # Process the inner elements: 5356 links = [] 5357 while reader.forward(): 5358 tag = reader.node_name() 5359 if tag == 'cluster': 5360 obj.cluster = ClusterReader.read_one(reader) 5361 elif tag == 'cpu_profile': 5362 obj.cpu_profile = CpuProfileReader.read_one(reader) 5363 elif tag == 'drivers_iso': 5364 obj.drivers_iso = FileReader.read_one(reader) 5365 elif tag == 'host': 5366 obj.host = HostReader.read_one(reader) 5367 elif tag == 'name': 5368 obj.name = Reader.read_string(reader) 5369 elif tag == 'password': 5370 obj.password = Reader.read_string(reader) 5371 elif tag == 'provider': 5372 obj.provider = Reader.read_enum(types.ExternalVmProviderType, reader) 5373 elif tag == 'quota': 5374 obj.quota = QuotaReader.read_one(reader) 5375 elif tag == 'sparse': 5376 obj.sparse = Reader.read_boolean(reader) 5377 elif tag == 'storage_domain': 5378 obj.storage_domain = StorageDomainReader.read_one(reader) 5379 elif tag == 'url': 5380 obj.url = Reader.read_string(reader) 5381 elif tag == 'username': 5382 obj.username = Reader.read_string(reader) 5383 elif tag == 'vm': 5384 obj.vm = VmReader.read_one(reader) 5385 else: 5386 reader.next_element() 5387 for link in links: 5388 ExternalVmImportReader._process_link(link, obj) 5389 5390 # Discard the end tag: 5391 reader.read() 5392 5393 return obj 5394 5395 @staticmethod 5396 def read_many(reader): 5397 # Do nothing if there aren't more tags: 5398 objs = List() 5399 if not reader.forward(): 5400 return objs 5401 5402 # Process the attributes: 5403 objs.href = reader.get_attribute('href') 5404 5405 # Discard the start tag: 5406 empty = reader.empty_element() 5407 reader.read() 5408 if empty: 5409 return objs 5410 5411 # Process the inner elements: 5412 while reader.forward(): 5413 objs.append(ExternalVmImportReader.read_one(reader)) 5414 5415 # Discard the end tag: 5416 reader.read() 5417 5418 return objs 5419 5420 5421class FaultReader(Reader): 5422 5423 def __init__(self): 5424 super(FaultReader, self).__init__() 5425 5426 @staticmethod 5427 def read_one(reader): 5428 # Do nothing if there aren't more tags: 5429 if not reader.forward(): 5430 return None 5431 5432 # Create the object: 5433 obj = types.Fault() 5434 5435 # Process the attributes: 5436 obj.href = reader.get_attribute('href') 5437 5438 # Discard the start tag: 5439 empty = reader.empty_element() 5440 reader.read() 5441 if empty: 5442 return obj 5443 5444 # Process the inner elements: 5445 links = [] 5446 while reader.forward(): 5447 tag = reader.node_name() 5448 if tag == 'detail': 5449 obj.detail = Reader.read_string(reader) 5450 elif tag == 'reason': 5451 obj.reason = Reader.read_string(reader) 5452 else: 5453 reader.next_element() 5454 for link in links: 5455 FaultReader._process_link(link, obj) 5456 5457 # Discard the end tag: 5458 reader.read() 5459 5460 return obj 5461 5462 @staticmethod 5463 def read_many(reader): 5464 # Do nothing if there aren't more tags: 5465 objs = List() 5466 if not reader.forward(): 5467 return objs 5468 5469 # Process the attributes: 5470 objs.href = reader.get_attribute('href') 5471 5472 # Discard the start tag: 5473 empty = reader.empty_element() 5474 reader.read() 5475 if empty: 5476 return objs 5477 5478 # Process the inner elements: 5479 while reader.forward(): 5480 objs.append(FaultReader.read_one(reader)) 5481 5482 # Discard the end tag: 5483 reader.read() 5484 5485 return objs 5486 5487 5488class FencingPolicyReader(Reader): 5489 5490 def __init__(self): 5491 super(FencingPolicyReader, self).__init__() 5492 5493 @staticmethod 5494 def read_one(reader): 5495 # Do nothing if there aren't more tags: 5496 if not reader.forward(): 5497 return None 5498 5499 # Create the object: 5500 obj = types.FencingPolicy() 5501 5502 # Process the attributes: 5503 obj.href = reader.get_attribute('href') 5504 5505 # Discard the start tag: 5506 empty = reader.empty_element() 5507 reader.read() 5508 if empty: 5509 return obj 5510 5511 # Process the inner elements: 5512 links = [] 5513 while reader.forward(): 5514 tag = reader.node_name() 5515 if tag == 'enabled': 5516 obj.enabled = Reader.read_boolean(reader) 5517 elif tag == 'skip_if_connectivity_broken': 5518 obj.skip_if_connectivity_broken = SkipIfConnectivityBrokenReader.read_one(reader) 5519 elif tag == 'skip_if_gluster_bricks_up': 5520 obj.skip_if_gluster_bricks_up = Reader.read_boolean(reader) 5521 elif tag == 'skip_if_gluster_quorum_not_met': 5522 obj.skip_if_gluster_quorum_not_met = Reader.read_boolean(reader) 5523 elif tag == 'skip_if_sd_active': 5524 obj.skip_if_sd_active = SkipIfSdActiveReader.read_one(reader) 5525 else: 5526 reader.next_element() 5527 for link in links: 5528 FencingPolicyReader._process_link(link, obj) 5529 5530 # Discard the end tag: 5531 reader.read() 5532 5533 return obj 5534 5535 @staticmethod 5536 def read_many(reader): 5537 # Do nothing if there aren't more tags: 5538 objs = List() 5539 if not reader.forward(): 5540 return objs 5541 5542 # Process the attributes: 5543 objs.href = reader.get_attribute('href') 5544 5545 # Discard the start tag: 5546 empty = reader.empty_element() 5547 reader.read() 5548 if empty: 5549 return objs 5550 5551 # Process the inner elements: 5552 while reader.forward(): 5553 objs.append(FencingPolicyReader.read_one(reader)) 5554 5555 # Discard the end tag: 5556 reader.read() 5557 5558 return objs 5559 5560 5561class FileReader(Reader): 5562 5563 def __init__(self): 5564 super(FileReader, self).__init__() 5565 5566 @staticmethod 5567 def read_one(reader): 5568 # Do nothing if there aren't more tags: 5569 if not reader.forward(): 5570 return None 5571 5572 # Create the object: 5573 obj = types.File() 5574 5575 # Process the attributes: 5576 obj.href = reader.get_attribute('href') 5577 value = reader.get_attribute('id') 5578 if value is not None: 5579 obj.id = value 5580 5581 # Discard the start tag: 5582 empty = reader.empty_element() 5583 reader.read() 5584 if empty: 5585 return obj 5586 5587 # Process the inner elements: 5588 links = [] 5589 while reader.forward(): 5590 tag = reader.node_name() 5591 if tag == 'comment': 5592 obj.comment = Reader.read_string(reader) 5593 elif tag == 'content': 5594 obj.content = Reader.read_string(reader) 5595 elif tag == 'description': 5596 obj.description = Reader.read_string(reader) 5597 elif tag == 'name': 5598 obj.name = Reader.read_string(reader) 5599 elif tag == 'storage_domain': 5600 obj.storage_domain = StorageDomainReader.read_one(reader) 5601 elif tag == 'type': 5602 obj.type = Reader.read_string(reader) 5603 else: 5604 reader.next_element() 5605 for link in links: 5606 FileReader._process_link(link, obj) 5607 5608 # Discard the end tag: 5609 reader.read() 5610 5611 return obj 5612 5613 @staticmethod 5614 def read_many(reader): 5615 # Do nothing if there aren't more tags: 5616 objs = List() 5617 if not reader.forward(): 5618 return objs 5619 5620 # Process the attributes: 5621 objs.href = reader.get_attribute('href') 5622 5623 # Discard the start tag: 5624 empty = reader.empty_element() 5625 reader.read() 5626 if empty: 5627 return objs 5628 5629 # Process the inner elements: 5630 while reader.forward(): 5631 objs.append(FileReader.read_one(reader)) 5632 5633 # Discard the end tag: 5634 reader.read() 5635 5636 return objs 5637 5638 5639class FilterReader(Reader): 5640 5641 def __init__(self): 5642 super(FilterReader, self).__init__() 5643 5644 @staticmethod 5645 def read_one(reader): 5646 # Do nothing if there aren't more tags: 5647 if not reader.forward(): 5648 return None 5649 5650 # Create the object: 5651 obj = types.Filter() 5652 5653 # Process the attributes: 5654 obj.href = reader.get_attribute('href') 5655 value = reader.get_attribute('id') 5656 if value is not None: 5657 obj.id = value 5658 5659 # Discard the start tag: 5660 empty = reader.empty_element() 5661 reader.read() 5662 if empty: 5663 return obj 5664 5665 # Process the inner elements: 5666 links = [] 5667 while reader.forward(): 5668 tag = reader.node_name() 5669 if tag == 'comment': 5670 obj.comment = Reader.read_string(reader) 5671 elif tag == 'description': 5672 obj.description = Reader.read_string(reader) 5673 elif tag == 'name': 5674 obj.name = Reader.read_string(reader) 5675 elif tag == 'position': 5676 obj.position = Reader.read_integer(reader) 5677 elif tag == 'scheduling_policy_unit': 5678 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 5679 else: 5680 reader.next_element() 5681 for link in links: 5682 FilterReader._process_link(link, obj) 5683 5684 # Discard the end tag: 5685 reader.read() 5686 5687 return obj 5688 5689 @staticmethod 5690 def read_many(reader): 5691 # Do nothing if there aren't more tags: 5692 objs = List() 5693 if not reader.forward(): 5694 return objs 5695 5696 # Process the attributes: 5697 objs.href = reader.get_attribute('href') 5698 5699 # Discard the start tag: 5700 empty = reader.empty_element() 5701 reader.read() 5702 if empty: 5703 return objs 5704 5705 # Process the inner elements: 5706 while reader.forward(): 5707 objs.append(FilterReader.read_one(reader)) 5708 5709 # Discard the end tag: 5710 reader.read() 5711 5712 return objs 5713 5714 5715class FloppyReader(Reader): 5716 5717 def __init__(self): 5718 super(FloppyReader, self).__init__() 5719 5720 @staticmethod 5721 def read_one(reader): 5722 # Do nothing if there aren't more tags: 5723 if not reader.forward(): 5724 return None 5725 5726 # Create the object: 5727 obj = types.Floppy() 5728 5729 # Process the attributes: 5730 obj.href = reader.get_attribute('href') 5731 value = reader.get_attribute('id') 5732 if value is not None: 5733 obj.id = value 5734 5735 # Discard the start tag: 5736 empty = reader.empty_element() 5737 reader.read() 5738 if empty: 5739 return obj 5740 5741 # Process the inner elements: 5742 links = [] 5743 while reader.forward(): 5744 tag = reader.node_name() 5745 if tag == 'comment': 5746 obj.comment = Reader.read_string(reader) 5747 elif tag == 'description': 5748 obj.description = Reader.read_string(reader) 5749 elif tag == 'file': 5750 obj.file = FileReader.read_one(reader) 5751 elif tag == 'instance_type': 5752 obj.instance_type = InstanceTypeReader.read_one(reader) 5753 elif tag == 'name': 5754 obj.name = Reader.read_string(reader) 5755 elif tag == 'template': 5756 obj.template = TemplateReader.read_one(reader) 5757 elif tag == 'vm': 5758 obj.vm = VmReader.read_one(reader) 5759 elif tag == 'vms': 5760 obj.vms = VmReader.read_many(reader) 5761 elif tag == 'link': 5762 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5763 reader.next_element() 5764 else: 5765 reader.next_element() 5766 for link in links: 5767 FloppyReader._process_link(link, obj) 5768 5769 # Discard the end tag: 5770 reader.read() 5771 5772 return obj 5773 5774 @staticmethod 5775 def read_many(reader): 5776 # Do nothing if there aren't more tags: 5777 objs = List() 5778 if not reader.forward(): 5779 return objs 5780 5781 # Process the attributes: 5782 objs.href = reader.get_attribute('href') 5783 5784 # Discard the start tag: 5785 empty = reader.empty_element() 5786 reader.read() 5787 if empty: 5788 return objs 5789 5790 # Process the inner elements: 5791 while reader.forward(): 5792 objs.append(FloppyReader.read_one(reader)) 5793 5794 # Discard the end tag: 5795 reader.read() 5796 5797 return objs 5798 5799 @staticmethod 5800 def _process_link(link, obj): 5801 # Process the attributes: 5802 rel = link[0] 5803 href = link[1] 5804 if href and rel: 5805 if rel == "vms": 5806 if obj.vms is not None: 5807 obj.vms.href = href 5808 else: 5809 obj.vms = List(href) 5810 5811 5812class FopStatisticReader(Reader): 5813 5814 def __init__(self): 5815 super(FopStatisticReader, self).__init__() 5816 5817 @staticmethod 5818 def read_one(reader): 5819 # Do nothing if there aren't more tags: 5820 if not reader.forward(): 5821 return None 5822 5823 # Create the object: 5824 obj = types.FopStatistic() 5825 5826 # Process the attributes: 5827 obj.href = reader.get_attribute('href') 5828 5829 # Discard the start tag: 5830 empty = reader.empty_element() 5831 reader.read() 5832 if empty: 5833 return obj 5834 5835 # Process the inner elements: 5836 links = [] 5837 while reader.forward(): 5838 tag = reader.node_name() 5839 if tag == 'name': 5840 obj.name = Reader.read_string(reader) 5841 elif tag == 'statistics': 5842 obj.statistics = StatisticReader.read_many(reader) 5843 else: 5844 reader.next_element() 5845 for link in links: 5846 FopStatisticReader._process_link(link, obj) 5847 5848 # Discard the end tag: 5849 reader.read() 5850 5851 return obj 5852 5853 @staticmethod 5854 def read_many(reader): 5855 # Do nothing if there aren't more tags: 5856 objs = List() 5857 if not reader.forward(): 5858 return objs 5859 5860 # Process the attributes: 5861 objs.href = reader.get_attribute('href') 5862 5863 # Discard the start tag: 5864 empty = reader.empty_element() 5865 reader.read() 5866 if empty: 5867 return objs 5868 5869 # Process the inner elements: 5870 while reader.forward(): 5871 objs.append(FopStatisticReader.read_one(reader)) 5872 5873 # Discard the end tag: 5874 reader.read() 5875 5876 return objs 5877 5878 5879class GlusterBrickReader(Reader): 5880 5881 def __init__(self): 5882 super(GlusterBrickReader, self).__init__() 5883 5884 @staticmethod 5885 def read_one(reader): 5886 # Do nothing if there aren't more tags: 5887 if not reader.forward(): 5888 return None 5889 5890 # Create the object: 5891 obj = types.GlusterBrick() 5892 5893 # Process the attributes: 5894 obj.href = reader.get_attribute('href') 5895 value = reader.get_attribute('id') 5896 if value is not None: 5897 obj.id = value 5898 5899 # Discard the start tag: 5900 empty = reader.empty_element() 5901 reader.read() 5902 if empty: 5903 return obj 5904 5905 # Process the inner elements: 5906 links = [] 5907 while reader.forward(): 5908 tag = reader.node_name() 5909 if tag == 'brick_dir': 5910 obj.brick_dir = Reader.read_string(reader) 5911 elif tag == 'comment': 5912 obj.comment = Reader.read_string(reader) 5913 elif tag == 'description': 5914 obj.description = Reader.read_string(reader) 5915 elif tag == 'device': 5916 obj.device = Reader.read_string(reader) 5917 elif tag == 'fs_name': 5918 obj.fs_name = Reader.read_string(reader) 5919 elif tag == 'gluster_clients': 5920 obj.gluster_clients = GlusterClientReader.read_many(reader) 5921 elif tag == 'gluster_volume': 5922 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 5923 elif tag == 'instance_type': 5924 obj.instance_type = InstanceTypeReader.read_one(reader) 5925 elif tag == 'memory_pools': 5926 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 5927 elif tag == 'mnt_options': 5928 obj.mnt_options = Reader.read_string(reader) 5929 elif tag == 'name': 5930 obj.name = Reader.read_string(reader) 5931 elif tag == 'pid': 5932 obj.pid = Reader.read_integer(reader) 5933 elif tag == 'port': 5934 obj.port = Reader.read_integer(reader) 5935 elif tag == 'server_id': 5936 obj.server_id = Reader.read_string(reader) 5937 elif tag == 'statistics': 5938 obj.statistics = StatisticReader.read_many(reader) 5939 elif tag == 'status': 5940 obj.status = Reader.read_enum(types.GlusterBrickStatus, reader) 5941 elif tag == 'template': 5942 obj.template = TemplateReader.read_one(reader) 5943 elif tag == 'vm': 5944 obj.vm = VmReader.read_one(reader) 5945 elif tag == 'vms': 5946 obj.vms = VmReader.read_many(reader) 5947 elif tag == 'link': 5948 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5949 reader.next_element() 5950 else: 5951 reader.next_element() 5952 for link in links: 5953 GlusterBrickReader._process_link(link, obj) 5954 5955 # Discard the end tag: 5956 reader.read() 5957 5958 return obj 5959 5960 @staticmethod 5961 def read_many(reader): 5962 # Do nothing if there aren't more tags: 5963 objs = List() 5964 if not reader.forward(): 5965 return objs 5966 5967 # Process the attributes: 5968 objs.href = reader.get_attribute('href') 5969 5970 # Discard the start tag: 5971 empty = reader.empty_element() 5972 reader.read() 5973 if empty: 5974 return objs 5975 5976 # Process the inner elements: 5977 while reader.forward(): 5978 objs.append(GlusterBrickReader.read_one(reader)) 5979 5980 # Discard the end tag: 5981 reader.read() 5982 5983 return objs 5984 5985 @staticmethod 5986 def _process_link(link, obj): 5987 # Process the attributes: 5988 rel = link[0] 5989 href = link[1] 5990 if href and rel: 5991 if rel == "statistics": 5992 if obj.statistics is not None: 5993 obj.statistics.href = href 5994 else: 5995 obj.statistics = List(href) 5996 elif rel == "vms": 5997 if obj.vms is not None: 5998 obj.vms.href = href 5999 else: 6000 obj.vms = List(href) 6001 6002 6003class GlusterBrickAdvancedDetailsReader(Reader): 6004 6005 def __init__(self): 6006 super(GlusterBrickAdvancedDetailsReader, self).__init__() 6007 6008 @staticmethod 6009 def read_one(reader): 6010 # Do nothing if there aren't more tags: 6011 if not reader.forward(): 6012 return None 6013 6014 # Create the object: 6015 obj = types.GlusterBrickAdvancedDetails() 6016 6017 # Process the attributes: 6018 obj.href = reader.get_attribute('href') 6019 value = reader.get_attribute('id') 6020 if value is not None: 6021 obj.id = value 6022 6023 # Discard the start tag: 6024 empty = reader.empty_element() 6025 reader.read() 6026 if empty: 6027 return obj 6028 6029 # Process the inner elements: 6030 links = [] 6031 while reader.forward(): 6032 tag = reader.node_name() 6033 if tag == 'comment': 6034 obj.comment = Reader.read_string(reader) 6035 elif tag == 'description': 6036 obj.description = Reader.read_string(reader) 6037 elif tag == 'device': 6038 obj.device = Reader.read_string(reader) 6039 elif tag == 'fs_name': 6040 obj.fs_name = Reader.read_string(reader) 6041 elif tag == 'gluster_clients': 6042 obj.gluster_clients = GlusterClientReader.read_many(reader) 6043 elif tag == 'instance_type': 6044 obj.instance_type = InstanceTypeReader.read_one(reader) 6045 elif tag == 'memory_pools': 6046 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6047 elif tag == 'mnt_options': 6048 obj.mnt_options = Reader.read_string(reader) 6049 elif tag == 'name': 6050 obj.name = Reader.read_string(reader) 6051 elif tag == 'pid': 6052 obj.pid = Reader.read_integer(reader) 6053 elif tag == 'port': 6054 obj.port = Reader.read_integer(reader) 6055 elif tag == 'template': 6056 obj.template = TemplateReader.read_one(reader) 6057 elif tag == 'vm': 6058 obj.vm = VmReader.read_one(reader) 6059 elif tag == 'vms': 6060 obj.vms = VmReader.read_many(reader) 6061 elif tag == 'link': 6062 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6063 reader.next_element() 6064 else: 6065 reader.next_element() 6066 for link in links: 6067 GlusterBrickAdvancedDetailsReader._process_link(link, obj) 6068 6069 # Discard the end tag: 6070 reader.read() 6071 6072 return obj 6073 6074 @staticmethod 6075 def read_many(reader): 6076 # Do nothing if there aren't more tags: 6077 objs = List() 6078 if not reader.forward(): 6079 return objs 6080 6081 # Process the attributes: 6082 objs.href = reader.get_attribute('href') 6083 6084 # Discard the start tag: 6085 empty = reader.empty_element() 6086 reader.read() 6087 if empty: 6088 return objs 6089 6090 # Process the inner elements: 6091 while reader.forward(): 6092 objs.append(GlusterBrickAdvancedDetailsReader.read_one(reader)) 6093 6094 # Discard the end tag: 6095 reader.read() 6096 6097 return objs 6098 6099 @staticmethod 6100 def _process_link(link, obj): 6101 # Process the attributes: 6102 rel = link[0] 6103 href = link[1] 6104 if href and rel: 6105 if rel == "vms": 6106 if obj.vms is not None: 6107 obj.vms.href = href 6108 else: 6109 obj.vms = List(href) 6110 6111 6112class GlusterBrickMemoryInfoReader(Reader): 6113 6114 def __init__(self): 6115 super(GlusterBrickMemoryInfoReader, self).__init__() 6116 6117 @staticmethod 6118 def read_one(reader): 6119 # Do nothing if there aren't more tags: 6120 if not reader.forward(): 6121 return None 6122 6123 # Create the object: 6124 obj = types.GlusterBrickMemoryInfo() 6125 6126 # Process the attributes: 6127 obj.href = reader.get_attribute('href') 6128 6129 # Discard the start tag: 6130 empty = reader.empty_element() 6131 reader.read() 6132 if empty: 6133 return obj 6134 6135 # Process the inner elements: 6136 links = [] 6137 while reader.forward(): 6138 tag = reader.node_name() 6139 if tag == 'memory_pools': 6140 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6141 else: 6142 reader.next_element() 6143 for link in links: 6144 GlusterBrickMemoryInfoReader._process_link(link, obj) 6145 6146 # Discard the end tag: 6147 reader.read() 6148 6149 return obj 6150 6151 @staticmethod 6152 def read_many(reader): 6153 # Do nothing if there aren't more tags: 6154 objs = List() 6155 if not reader.forward(): 6156 return objs 6157 6158 # Process the attributes: 6159 objs.href = reader.get_attribute('href') 6160 6161 # Discard the start tag: 6162 empty = reader.empty_element() 6163 reader.read() 6164 if empty: 6165 return objs 6166 6167 # Process the inner elements: 6168 while reader.forward(): 6169 objs.append(GlusterBrickMemoryInfoReader.read_one(reader)) 6170 6171 # Discard the end tag: 6172 reader.read() 6173 6174 return objs 6175 6176 6177class GlusterClientReader(Reader): 6178 6179 def __init__(self): 6180 super(GlusterClientReader, self).__init__() 6181 6182 @staticmethod 6183 def read_one(reader): 6184 # Do nothing if there aren't more tags: 6185 if not reader.forward(): 6186 return None 6187 6188 # Create the object: 6189 obj = types.GlusterClient() 6190 6191 # Process the attributes: 6192 obj.href = reader.get_attribute('href') 6193 6194 # Discard the start tag: 6195 empty = reader.empty_element() 6196 reader.read() 6197 if empty: 6198 return obj 6199 6200 # Process the inner elements: 6201 links = [] 6202 while reader.forward(): 6203 tag = reader.node_name() 6204 if tag == 'bytes_read': 6205 obj.bytes_read = Reader.read_integer(reader) 6206 elif tag == 'bytes_written': 6207 obj.bytes_written = Reader.read_integer(reader) 6208 elif tag == 'client_port': 6209 obj.client_port = Reader.read_integer(reader) 6210 elif tag == 'host_name': 6211 obj.host_name = Reader.read_string(reader) 6212 else: 6213 reader.next_element() 6214 for link in links: 6215 GlusterClientReader._process_link(link, obj) 6216 6217 # Discard the end tag: 6218 reader.read() 6219 6220 return obj 6221 6222 @staticmethod 6223 def read_many(reader): 6224 # Do nothing if there aren't more tags: 6225 objs = List() 6226 if not reader.forward(): 6227 return objs 6228 6229 # Process the attributes: 6230 objs.href = reader.get_attribute('href') 6231 6232 # Discard the start tag: 6233 empty = reader.empty_element() 6234 reader.read() 6235 if empty: 6236 return objs 6237 6238 # Process the inner elements: 6239 while reader.forward(): 6240 objs.append(GlusterClientReader.read_one(reader)) 6241 6242 # Discard the end tag: 6243 reader.read() 6244 6245 return objs 6246 6247 6248class GlusterHookReader(Reader): 6249 6250 def __init__(self): 6251 super(GlusterHookReader, self).__init__() 6252 6253 @staticmethod 6254 def read_one(reader): 6255 # Do nothing if there aren't more tags: 6256 if not reader.forward(): 6257 return None 6258 6259 # Create the object: 6260 obj = types.GlusterHook() 6261 6262 # Process the attributes: 6263 obj.href = reader.get_attribute('href') 6264 value = reader.get_attribute('id') 6265 if value is not None: 6266 obj.id = value 6267 6268 # Discard the start tag: 6269 empty = reader.empty_element() 6270 reader.read() 6271 if empty: 6272 return obj 6273 6274 # Process the inner elements: 6275 links = [] 6276 while reader.forward(): 6277 tag = reader.node_name() 6278 if tag == 'checksum': 6279 obj.checksum = Reader.read_string(reader) 6280 elif tag == 'cluster': 6281 obj.cluster = ClusterReader.read_one(reader) 6282 elif tag == 'comment': 6283 obj.comment = Reader.read_string(reader) 6284 elif tag == 'conflict_status': 6285 obj.conflict_status = Reader.read_integer(reader) 6286 elif tag == 'conflicts': 6287 obj.conflicts = Reader.read_string(reader) 6288 elif tag == 'content': 6289 obj.content = Reader.read_string(reader) 6290 elif tag == 'content_type': 6291 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6292 elif tag == 'description': 6293 obj.description = Reader.read_string(reader) 6294 elif tag == 'gluster_command': 6295 obj.gluster_command = Reader.read_string(reader) 6296 elif tag == 'name': 6297 obj.name = Reader.read_string(reader) 6298 elif tag == 'server_hooks': 6299 obj.server_hooks = GlusterServerHookReader.read_many(reader) 6300 elif tag == 'stage': 6301 obj.stage = Reader.read_enum(types.HookStage, reader) 6302 elif tag == 'status': 6303 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6304 elif tag == 'link': 6305 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6306 reader.next_element() 6307 else: 6308 reader.next_element() 6309 for link in links: 6310 GlusterHookReader._process_link(link, obj) 6311 6312 # Discard the end tag: 6313 reader.read() 6314 6315 return obj 6316 6317 @staticmethod 6318 def read_many(reader): 6319 # Do nothing if there aren't more tags: 6320 objs = List() 6321 if not reader.forward(): 6322 return objs 6323 6324 # Process the attributes: 6325 objs.href = reader.get_attribute('href') 6326 6327 # Discard the start tag: 6328 empty = reader.empty_element() 6329 reader.read() 6330 if empty: 6331 return objs 6332 6333 # Process the inner elements: 6334 while reader.forward(): 6335 objs.append(GlusterHookReader.read_one(reader)) 6336 6337 # Discard the end tag: 6338 reader.read() 6339 6340 return objs 6341 6342 @staticmethod 6343 def _process_link(link, obj): 6344 # Process the attributes: 6345 rel = link[0] 6346 href = link[1] 6347 if href and rel: 6348 if rel == "serverhooks": 6349 if obj.server_hooks is not None: 6350 obj.server_hooks.href = href 6351 else: 6352 obj.server_hooks = List(href) 6353 6354 6355class GlusterMemoryPoolReader(Reader): 6356 6357 def __init__(self): 6358 super(GlusterMemoryPoolReader, self).__init__() 6359 6360 @staticmethod 6361 def read_one(reader): 6362 # Do nothing if there aren't more tags: 6363 if not reader.forward(): 6364 return None 6365 6366 # Create the object: 6367 obj = types.GlusterMemoryPool() 6368 6369 # Process the attributes: 6370 obj.href = reader.get_attribute('href') 6371 value = reader.get_attribute('id') 6372 if value is not None: 6373 obj.id = value 6374 6375 # Discard the start tag: 6376 empty = reader.empty_element() 6377 reader.read() 6378 if empty: 6379 return obj 6380 6381 # Process the inner elements: 6382 links = [] 6383 while reader.forward(): 6384 tag = reader.node_name() 6385 if tag == 'alloc_count': 6386 obj.alloc_count = Reader.read_integer(reader) 6387 elif tag == 'cold_count': 6388 obj.cold_count = Reader.read_integer(reader) 6389 elif tag == 'comment': 6390 obj.comment = Reader.read_string(reader) 6391 elif tag == 'description': 6392 obj.description = Reader.read_string(reader) 6393 elif tag == 'hot_count': 6394 obj.hot_count = Reader.read_integer(reader) 6395 elif tag == 'max_alloc': 6396 obj.max_alloc = Reader.read_integer(reader) 6397 elif tag == 'max_stdalloc': 6398 obj.max_stdalloc = Reader.read_integer(reader) 6399 elif tag == 'name': 6400 obj.name = Reader.read_string(reader) 6401 elif tag == 'padded_size': 6402 obj.padded_size = Reader.read_integer(reader) 6403 elif tag == 'pool_misses': 6404 obj.pool_misses = Reader.read_integer(reader) 6405 elif tag == 'type': 6406 obj.type = Reader.read_string(reader) 6407 else: 6408 reader.next_element() 6409 for link in links: 6410 GlusterMemoryPoolReader._process_link(link, obj) 6411 6412 # Discard the end tag: 6413 reader.read() 6414 6415 return obj 6416 6417 @staticmethod 6418 def read_many(reader): 6419 # Do nothing if there aren't more tags: 6420 objs = List() 6421 if not reader.forward(): 6422 return objs 6423 6424 # Process the attributes: 6425 objs.href = reader.get_attribute('href') 6426 6427 # Discard the start tag: 6428 empty = reader.empty_element() 6429 reader.read() 6430 if empty: 6431 return objs 6432 6433 # Process the inner elements: 6434 while reader.forward(): 6435 objs.append(GlusterMemoryPoolReader.read_one(reader)) 6436 6437 # Discard the end tag: 6438 reader.read() 6439 6440 return objs 6441 6442 6443class GlusterServerHookReader(Reader): 6444 6445 def __init__(self): 6446 super(GlusterServerHookReader, self).__init__() 6447 6448 @staticmethod 6449 def read_one(reader): 6450 # Do nothing if there aren't more tags: 6451 if not reader.forward(): 6452 return None 6453 6454 # Create the object: 6455 obj = types.GlusterServerHook() 6456 6457 # Process the attributes: 6458 obj.href = reader.get_attribute('href') 6459 value = reader.get_attribute('id') 6460 if value is not None: 6461 obj.id = value 6462 6463 # Discard the start tag: 6464 empty = reader.empty_element() 6465 reader.read() 6466 if empty: 6467 return obj 6468 6469 # Process the inner elements: 6470 links = [] 6471 while reader.forward(): 6472 tag = reader.node_name() 6473 if tag == 'checksum': 6474 obj.checksum = Reader.read_string(reader) 6475 elif tag == 'comment': 6476 obj.comment = Reader.read_string(reader) 6477 elif tag == 'content_type': 6478 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6479 elif tag == 'description': 6480 obj.description = Reader.read_string(reader) 6481 elif tag == 'host': 6482 obj.host = HostReader.read_one(reader) 6483 elif tag == 'name': 6484 obj.name = Reader.read_string(reader) 6485 elif tag == 'status': 6486 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6487 else: 6488 reader.next_element() 6489 for link in links: 6490 GlusterServerHookReader._process_link(link, obj) 6491 6492 # Discard the end tag: 6493 reader.read() 6494 6495 return obj 6496 6497 @staticmethod 6498 def read_many(reader): 6499 # Do nothing if there aren't more tags: 6500 objs = List() 6501 if not reader.forward(): 6502 return objs 6503 6504 # Process the attributes: 6505 objs.href = reader.get_attribute('href') 6506 6507 # Discard the start tag: 6508 empty = reader.empty_element() 6509 reader.read() 6510 if empty: 6511 return objs 6512 6513 # Process the inner elements: 6514 while reader.forward(): 6515 objs.append(GlusterServerHookReader.read_one(reader)) 6516 6517 # Discard the end tag: 6518 reader.read() 6519 6520 return objs 6521 6522 6523class GlusterVolumeReader(Reader): 6524 6525 def __init__(self): 6526 super(GlusterVolumeReader, self).__init__() 6527 6528 @staticmethod 6529 def read_one(reader): 6530 # Do nothing if there aren't more tags: 6531 if not reader.forward(): 6532 return None 6533 6534 # Create the object: 6535 obj = types.GlusterVolume() 6536 6537 # Process the attributes: 6538 obj.href = reader.get_attribute('href') 6539 value = reader.get_attribute('id') 6540 if value is not None: 6541 obj.id = value 6542 6543 # Discard the start tag: 6544 empty = reader.empty_element() 6545 reader.read() 6546 if empty: 6547 return obj 6548 6549 # Process the inner elements: 6550 links = [] 6551 while reader.forward(): 6552 tag = reader.node_name() 6553 if tag == 'bricks': 6554 obj.bricks = GlusterBrickReader.read_many(reader) 6555 elif tag == 'cluster': 6556 obj.cluster = ClusterReader.read_one(reader) 6557 elif tag == 'comment': 6558 obj.comment = Reader.read_string(reader) 6559 elif tag == 'description': 6560 obj.description = Reader.read_string(reader) 6561 elif tag == 'disperse_count': 6562 obj.disperse_count = Reader.read_integer(reader) 6563 elif tag == 'name': 6564 obj.name = Reader.read_string(reader) 6565 elif tag == 'options': 6566 obj.options = OptionReader.read_many(reader) 6567 elif tag == 'redundancy_count': 6568 obj.redundancy_count = Reader.read_integer(reader) 6569 elif tag == 'replica_count': 6570 obj.replica_count = Reader.read_integer(reader) 6571 elif tag == 'statistics': 6572 obj.statistics = StatisticReader.read_many(reader) 6573 elif tag == 'status': 6574 obj.status = Reader.read_enum(types.GlusterVolumeStatus, reader) 6575 elif tag == 'stripe_count': 6576 obj.stripe_count = Reader.read_integer(reader) 6577 elif tag == 'transport_types': 6578 obj.transport_types = Reader.read_enums(types.TransportType, reader) 6579 elif tag == 'volume_type': 6580 obj.volume_type = Reader.read_enum(types.GlusterVolumeType, reader) 6581 elif tag == 'link': 6582 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6583 reader.next_element() 6584 else: 6585 reader.next_element() 6586 for link in links: 6587 GlusterVolumeReader._process_link(link, obj) 6588 6589 # Discard the end tag: 6590 reader.read() 6591 6592 return obj 6593 6594 @staticmethod 6595 def read_many(reader): 6596 # Do nothing if there aren't more tags: 6597 objs = List() 6598 if not reader.forward(): 6599 return objs 6600 6601 # Process the attributes: 6602 objs.href = reader.get_attribute('href') 6603 6604 # Discard the start tag: 6605 empty = reader.empty_element() 6606 reader.read() 6607 if empty: 6608 return objs 6609 6610 # Process the inner elements: 6611 while reader.forward(): 6612 objs.append(GlusterVolumeReader.read_one(reader)) 6613 6614 # Discard the end tag: 6615 reader.read() 6616 6617 return objs 6618 6619 @staticmethod 6620 def _process_link(link, obj): 6621 # Process the attributes: 6622 rel = link[0] 6623 href = link[1] 6624 if href and rel: 6625 if rel == "bricks": 6626 if obj.bricks is not None: 6627 obj.bricks.href = href 6628 else: 6629 obj.bricks = List(href) 6630 elif rel == "statistics": 6631 if obj.statistics is not None: 6632 obj.statistics.href = href 6633 else: 6634 obj.statistics = List(href) 6635 6636 6637class GlusterVolumeProfileDetailsReader(Reader): 6638 6639 def __init__(self): 6640 super(GlusterVolumeProfileDetailsReader, self).__init__() 6641 6642 @staticmethod 6643 def read_one(reader): 6644 # Do nothing if there aren't more tags: 6645 if not reader.forward(): 6646 return None 6647 6648 # Create the object: 6649 obj = types.GlusterVolumeProfileDetails() 6650 6651 # Process the attributes: 6652 obj.href = reader.get_attribute('href') 6653 value = reader.get_attribute('id') 6654 if value is not None: 6655 obj.id = value 6656 6657 # Discard the start tag: 6658 empty = reader.empty_element() 6659 reader.read() 6660 if empty: 6661 return obj 6662 6663 # Process the inner elements: 6664 links = [] 6665 while reader.forward(): 6666 tag = reader.node_name() 6667 if tag == 'brick_profile_details': 6668 obj.brick_profile_details = BrickProfileDetailReader.read_many(reader) 6669 elif tag == 'comment': 6670 obj.comment = Reader.read_string(reader) 6671 elif tag == 'description': 6672 obj.description = Reader.read_string(reader) 6673 elif tag == 'name': 6674 obj.name = Reader.read_string(reader) 6675 elif tag == 'nfs_profile_details': 6676 obj.nfs_profile_details = NfsProfileDetailReader.read_many(reader) 6677 else: 6678 reader.next_element() 6679 for link in links: 6680 GlusterVolumeProfileDetailsReader._process_link(link, obj) 6681 6682 # Discard the end tag: 6683 reader.read() 6684 6685 return obj 6686 6687 @staticmethod 6688 def read_many(reader): 6689 # Do nothing if there aren't more tags: 6690 objs = List() 6691 if not reader.forward(): 6692 return objs 6693 6694 # Process the attributes: 6695 objs.href = reader.get_attribute('href') 6696 6697 # Discard the start tag: 6698 empty = reader.empty_element() 6699 reader.read() 6700 if empty: 6701 return objs 6702 6703 # Process the inner elements: 6704 while reader.forward(): 6705 objs.append(GlusterVolumeProfileDetailsReader.read_one(reader)) 6706 6707 # Discard the end tag: 6708 reader.read() 6709 6710 return objs 6711 6712 6713class GracePeriodReader(Reader): 6714 6715 def __init__(self): 6716 super(GracePeriodReader, self).__init__() 6717 6718 @staticmethod 6719 def read_one(reader): 6720 # Do nothing if there aren't more tags: 6721 if not reader.forward(): 6722 return None 6723 6724 # Create the object: 6725 obj = types.GracePeriod() 6726 6727 # Process the attributes: 6728 obj.href = reader.get_attribute('href') 6729 6730 # Discard the start tag: 6731 empty = reader.empty_element() 6732 reader.read() 6733 if empty: 6734 return obj 6735 6736 # Process the inner elements: 6737 links = [] 6738 while reader.forward(): 6739 tag = reader.node_name() 6740 if tag == 'expiry': 6741 obj.expiry = Reader.read_integer(reader) 6742 else: 6743 reader.next_element() 6744 for link in links: 6745 GracePeriodReader._process_link(link, obj) 6746 6747 # Discard the end tag: 6748 reader.read() 6749 6750 return obj 6751 6752 @staticmethod 6753 def read_many(reader): 6754 # Do nothing if there aren't more tags: 6755 objs = List() 6756 if not reader.forward(): 6757 return objs 6758 6759 # Process the attributes: 6760 objs.href = reader.get_attribute('href') 6761 6762 # Discard the start tag: 6763 empty = reader.empty_element() 6764 reader.read() 6765 if empty: 6766 return objs 6767 6768 # Process the inner elements: 6769 while reader.forward(): 6770 objs.append(GracePeriodReader.read_one(reader)) 6771 6772 # Discard the end tag: 6773 reader.read() 6774 6775 return objs 6776 6777 6778class GraphicsConsoleReader(Reader): 6779 6780 def __init__(self): 6781 super(GraphicsConsoleReader, self).__init__() 6782 6783 @staticmethod 6784 def read_one(reader): 6785 # Do nothing if there aren't more tags: 6786 if not reader.forward(): 6787 return None 6788 6789 # Create the object: 6790 obj = types.GraphicsConsole() 6791 6792 # Process the attributes: 6793 obj.href = reader.get_attribute('href') 6794 value = reader.get_attribute('id') 6795 if value is not None: 6796 obj.id = value 6797 6798 # Discard the start tag: 6799 empty = reader.empty_element() 6800 reader.read() 6801 if empty: 6802 return obj 6803 6804 # Process the inner elements: 6805 links = [] 6806 while reader.forward(): 6807 tag = reader.node_name() 6808 if tag == 'address': 6809 obj.address = Reader.read_string(reader) 6810 elif tag == 'comment': 6811 obj.comment = Reader.read_string(reader) 6812 elif tag == 'description': 6813 obj.description = Reader.read_string(reader) 6814 elif tag == 'instance_type': 6815 obj.instance_type = InstanceTypeReader.read_one(reader) 6816 elif tag == 'name': 6817 obj.name = Reader.read_string(reader) 6818 elif tag == 'port': 6819 obj.port = Reader.read_integer(reader) 6820 elif tag == 'protocol': 6821 obj.protocol = Reader.read_enum(types.GraphicsType, reader) 6822 elif tag == 'template': 6823 obj.template = TemplateReader.read_one(reader) 6824 elif tag == 'tls_port': 6825 obj.tls_port = Reader.read_integer(reader) 6826 elif tag == 'vm': 6827 obj.vm = VmReader.read_one(reader) 6828 else: 6829 reader.next_element() 6830 for link in links: 6831 GraphicsConsoleReader._process_link(link, obj) 6832 6833 # Discard the end tag: 6834 reader.read() 6835 6836 return obj 6837 6838 @staticmethod 6839 def read_many(reader): 6840 # Do nothing if there aren't more tags: 6841 objs = List() 6842 if not reader.forward(): 6843 return objs 6844 6845 # Process the attributes: 6846 objs.href = reader.get_attribute('href') 6847 6848 # Discard the start tag: 6849 empty = reader.empty_element() 6850 reader.read() 6851 if empty: 6852 return objs 6853 6854 # Process the inner elements: 6855 while reader.forward(): 6856 objs.append(GraphicsConsoleReader.read_one(reader)) 6857 6858 # Discard the end tag: 6859 reader.read() 6860 6861 return objs 6862 6863 6864class GroupReader(Reader): 6865 6866 def __init__(self): 6867 super(GroupReader, self).__init__() 6868 6869 @staticmethod 6870 def read_one(reader): 6871 # Do nothing if there aren't more tags: 6872 if not reader.forward(): 6873 return None 6874 6875 # Create the object: 6876 obj = types.Group() 6877 6878 # Process the attributes: 6879 obj.href = reader.get_attribute('href') 6880 value = reader.get_attribute('id') 6881 if value is not None: 6882 obj.id = value 6883 6884 # Discard the start tag: 6885 empty = reader.empty_element() 6886 reader.read() 6887 if empty: 6888 return obj 6889 6890 # Process the inner elements: 6891 links = [] 6892 while reader.forward(): 6893 tag = reader.node_name() 6894 if tag == 'comment': 6895 obj.comment = Reader.read_string(reader) 6896 elif tag == 'description': 6897 obj.description = Reader.read_string(reader) 6898 elif tag == 'domain': 6899 obj.domain = DomainReader.read_one(reader) 6900 elif tag == 'domain_entry_id': 6901 obj.domain_entry_id = Reader.read_string(reader) 6902 elif tag == 'name': 6903 obj.name = Reader.read_string(reader) 6904 elif tag == 'namespace': 6905 obj.namespace = Reader.read_string(reader) 6906 elif tag == 'permissions': 6907 obj.permissions = PermissionReader.read_many(reader) 6908 elif tag == 'roles': 6909 obj.roles = RoleReader.read_many(reader) 6910 elif tag == 'tags': 6911 obj.tags = TagReader.read_many(reader) 6912 elif tag == 'link': 6913 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6914 reader.next_element() 6915 else: 6916 reader.next_element() 6917 for link in links: 6918 GroupReader._process_link(link, obj) 6919 6920 # Discard the end tag: 6921 reader.read() 6922 6923 return obj 6924 6925 @staticmethod 6926 def read_many(reader): 6927 # Do nothing if there aren't more tags: 6928 objs = List() 6929 if not reader.forward(): 6930 return objs 6931 6932 # Process the attributes: 6933 objs.href = reader.get_attribute('href') 6934 6935 # Discard the start tag: 6936 empty = reader.empty_element() 6937 reader.read() 6938 if empty: 6939 return objs 6940 6941 # Process the inner elements: 6942 while reader.forward(): 6943 objs.append(GroupReader.read_one(reader)) 6944 6945 # Discard the end tag: 6946 reader.read() 6947 6948 return objs 6949 6950 @staticmethod 6951 def _process_link(link, obj): 6952 # Process the attributes: 6953 rel = link[0] 6954 href = link[1] 6955 if href and rel: 6956 if rel == "permissions": 6957 if obj.permissions is not None: 6958 obj.permissions.href = href 6959 else: 6960 obj.permissions = List(href) 6961 elif rel == "roles": 6962 if obj.roles is not None: 6963 obj.roles.href = href 6964 else: 6965 obj.roles = List(href) 6966 elif rel == "tags": 6967 if obj.tags is not None: 6968 obj.tags.href = href 6969 else: 6970 obj.tags = List(href) 6971 6972 6973class GuestOperatingSystemReader(Reader): 6974 6975 def __init__(self): 6976 super(GuestOperatingSystemReader, self).__init__() 6977 6978 @staticmethod 6979 def read_one(reader): 6980 # Do nothing if there aren't more tags: 6981 if not reader.forward(): 6982 return None 6983 6984 # Create the object: 6985 obj = types.GuestOperatingSystem() 6986 6987 # Process the attributes: 6988 obj.href = reader.get_attribute('href') 6989 6990 # Discard the start tag: 6991 empty = reader.empty_element() 6992 reader.read() 6993 if empty: 6994 return obj 6995 6996 # Process the inner elements: 6997 links = [] 6998 while reader.forward(): 6999 tag = reader.node_name() 7000 if tag == 'architecture': 7001 obj.architecture = Reader.read_string(reader) 7002 elif tag == 'codename': 7003 obj.codename = Reader.read_string(reader) 7004 elif tag == 'distribution': 7005 obj.distribution = Reader.read_string(reader) 7006 elif tag == 'family': 7007 obj.family = Reader.read_string(reader) 7008 elif tag == 'kernel': 7009 obj.kernel = KernelReader.read_one(reader) 7010 elif tag == 'version': 7011 obj.version = VersionReader.read_one(reader) 7012 else: 7013 reader.next_element() 7014 for link in links: 7015 GuestOperatingSystemReader._process_link(link, obj) 7016 7017 # Discard the end tag: 7018 reader.read() 7019 7020 return obj 7021 7022 @staticmethod 7023 def read_many(reader): 7024 # Do nothing if there aren't more tags: 7025 objs = List() 7026 if not reader.forward(): 7027 return objs 7028 7029 # Process the attributes: 7030 objs.href = reader.get_attribute('href') 7031 7032 # Discard the start tag: 7033 empty = reader.empty_element() 7034 reader.read() 7035 if empty: 7036 return objs 7037 7038 # Process the inner elements: 7039 while reader.forward(): 7040 objs.append(GuestOperatingSystemReader.read_one(reader)) 7041 7042 # Discard the end tag: 7043 reader.read() 7044 7045 return objs 7046 7047 7048class HardwareInformationReader(Reader): 7049 7050 def __init__(self): 7051 super(HardwareInformationReader, self).__init__() 7052 7053 @staticmethod 7054 def read_one(reader): 7055 # Do nothing if there aren't more tags: 7056 if not reader.forward(): 7057 return None 7058 7059 # Create the object: 7060 obj = types.HardwareInformation() 7061 7062 # Process the attributes: 7063 obj.href = reader.get_attribute('href') 7064 7065 # Discard the start tag: 7066 empty = reader.empty_element() 7067 reader.read() 7068 if empty: 7069 return obj 7070 7071 # Process the inner elements: 7072 links = [] 7073 while reader.forward(): 7074 tag = reader.node_name() 7075 if tag == 'family': 7076 obj.family = Reader.read_string(reader) 7077 elif tag == 'manufacturer': 7078 obj.manufacturer = Reader.read_string(reader) 7079 elif tag == 'product_name': 7080 obj.product_name = Reader.read_string(reader) 7081 elif tag == 'serial_number': 7082 obj.serial_number = Reader.read_string(reader) 7083 elif tag == 'supported_rng_sources': 7084 obj.supported_rng_sources = Reader.read_enums(types.RngSource, reader) 7085 elif tag == 'uuid': 7086 obj.uuid = Reader.read_string(reader) 7087 elif tag == 'version': 7088 obj.version = Reader.read_string(reader) 7089 else: 7090 reader.next_element() 7091 for link in links: 7092 HardwareInformationReader._process_link(link, obj) 7093 7094 # Discard the end tag: 7095 reader.read() 7096 7097 return obj 7098 7099 @staticmethod 7100 def read_many(reader): 7101 # Do nothing if there aren't more tags: 7102 objs = List() 7103 if not reader.forward(): 7104 return objs 7105 7106 # Process the attributes: 7107 objs.href = reader.get_attribute('href') 7108 7109 # Discard the start tag: 7110 empty = reader.empty_element() 7111 reader.read() 7112 if empty: 7113 return objs 7114 7115 # Process the inner elements: 7116 while reader.forward(): 7117 objs.append(HardwareInformationReader.read_one(reader)) 7118 7119 # Discard the end tag: 7120 reader.read() 7121 7122 return objs 7123 7124 7125class HighAvailabilityReader(Reader): 7126 7127 def __init__(self): 7128 super(HighAvailabilityReader, self).__init__() 7129 7130 @staticmethod 7131 def read_one(reader): 7132 # Do nothing if there aren't more tags: 7133 if not reader.forward(): 7134 return None 7135 7136 # Create the object: 7137 obj = types.HighAvailability() 7138 7139 # Process the attributes: 7140 obj.href = reader.get_attribute('href') 7141 7142 # Discard the start tag: 7143 empty = reader.empty_element() 7144 reader.read() 7145 if empty: 7146 return obj 7147 7148 # Process the inner elements: 7149 links = [] 7150 while reader.forward(): 7151 tag = reader.node_name() 7152 if tag == 'enabled': 7153 obj.enabled = Reader.read_boolean(reader) 7154 elif tag == 'priority': 7155 obj.priority = Reader.read_integer(reader) 7156 else: 7157 reader.next_element() 7158 for link in links: 7159 HighAvailabilityReader._process_link(link, obj) 7160 7161 # Discard the end tag: 7162 reader.read() 7163 7164 return obj 7165 7166 @staticmethod 7167 def read_many(reader): 7168 # Do nothing if there aren't more tags: 7169 objs = List() 7170 if not reader.forward(): 7171 return objs 7172 7173 # Process the attributes: 7174 objs.href = reader.get_attribute('href') 7175 7176 # Discard the start tag: 7177 empty = reader.empty_element() 7178 reader.read() 7179 if empty: 7180 return objs 7181 7182 # Process the inner elements: 7183 while reader.forward(): 7184 objs.append(HighAvailabilityReader.read_one(reader)) 7185 7186 # Discard the end tag: 7187 reader.read() 7188 7189 return objs 7190 7191 7192class HookReader(Reader): 7193 7194 def __init__(self): 7195 super(HookReader, self).__init__() 7196 7197 @staticmethod 7198 def read_one(reader): 7199 # Do nothing if there aren't more tags: 7200 if not reader.forward(): 7201 return None 7202 7203 # Create the object: 7204 obj = types.Hook() 7205 7206 # Process the attributes: 7207 obj.href = reader.get_attribute('href') 7208 value = reader.get_attribute('id') 7209 if value is not None: 7210 obj.id = value 7211 7212 # Discard the start tag: 7213 empty = reader.empty_element() 7214 reader.read() 7215 if empty: 7216 return obj 7217 7218 # Process the inner elements: 7219 links = [] 7220 while reader.forward(): 7221 tag = reader.node_name() 7222 if tag == 'comment': 7223 obj.comment = Reader.read_string(reader) 7224 elif tag == 'description': 7225 obj.description = Reader.read_string(reader) 7226 elif tag == 'event_name': 7227 obj.event_name = Reader.read_string(reader) 7228 elif tag == 'host': 7229 obj.host = HostReader.read_one(reader) 7230 elif tag == 'md5': 7231 obj.md5 = Reader.read_string(reader) 7232 elif tag == 'name': 7233 obj.name = Reader.read_string(reader) 7234 else: 7235 reader.next_element() 7236 for link in links: 7237 HookReader._process_link(link, obj) 7238 7239 # Discard the end tag: 7240 reader.read() 7241 7242 return obj 7243 7244 @staticmethod 7245 def read_many(reader): 7246 # Do nothing if there aren't more tags: 7247 objs = List() 7248 if not reader.forward(): 7249 return objs 7250 7251 # Process the attributes: 7252 objs.href = reader.get_attribute('href') 7253 7254 # Discard the start tag: 7255 empty = reader.empty_element() 7256 reader.read() 7257 if empty: 7258 return objs 7259 7260 # Process the inner elements: 7261 while reader.forward(): 7262 objs.append(HookReader.read_one(reader)) 7263 7264 # Discard the end tag: 7265 reader.read() 7266 7267 return objs 7268 7269 7270class HostReader(Reader): 7271 7272 def __init__(self): 7273 super(HostReader, self).__init__() 7274 7275 @staticmethod 7276 def read_one(reader): 7277 # Do nothing if there aren't more tags: 7278 if not reader.forward(): 7279 return None 7280 7281 # Create the object: 7282 obj = types.Host() 7283 7284 # Process the attributes: 7285 obj.href = reader.get_attribute('href') 7286 value = reader.get_attribute('id') 7287 if value is not None: 7288 obj.id = value 7289 7290 # Discard the start tag: 7291 empty = reader.empty_element() 7292 reader.read() 7293 if empty: 7294 return obj 7295 7296 # Process the inner elements: 7297 links = [] 7298 while reader.forward(): 7299 tag = reader.node_name() 7300 if tag == 'address': 7301 obj.address = Reader.read_string(reader) 7302 elif tag == 'affinity_labels': 7303 obj.affinity_labels = AffinityLabelReader.read_many(reader) 7304 elif tag == 'agents': 7305 obj.agents = AgentReader.read_many(reader) 7306 elif tag == 'auto_numa_status': 7307 obj.auto_numa_status = Reader.read_enum(types.AutoNumaStatus, reader) 7308 elif tag == 'certificate': 7309 obj.certificate = CertificateReader.read_one(reader) 7310 elif tag == 'cluster': 7311 obj.cluster = ClusterReader.read_one(reader) 7312 elif tag == 'comment': 7313 obj.comment = Reader.read_string(reader) 7314 elif tag == 'cpu': 7315 obj.cpu = CpuReader.read_one(reader) 7316 elif tag == 'cpu_units': 7317 obj.cpu_units = HostCpuUnitReader.read_many(reader) 7318 elif tag == 'description': 7319 obj.description = Reader.read_string(reader) 7320 elif tag == 'device_passthrough': 7321 obj.device_passthrough = HostDevicePassthroughReader.read_one(reader) 7322 elif tag == 'devices': 7323 obj.devices = HostDeviceReader.read_many(reader) 7324 elif tag == 'display': 7325 obj.display = DisplayReader.read_one(reader) 7326 elif tag == 'external_host_provider': 7327 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 7328 elif tag == 'external_network_provider_configurations': 7329 obj.external_network_provider_configurations = ExternalNetworkProviderConfigurationReader.read_many(reader) 7330 elif tag == 'external_status': 7331 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 7332 elif tag == 'hardware_information': 7333 obj.hardware_information = HardwareInformationReader.read_one(reader) 7334 elif tag == 'hooks': 7335 obj.hooks = HookReader.read_many(reader) 7336 elif tag == 'hosted_engine': 7337 obj.hosted_engine = HostedEngineReader.read_one(reader) 7338 elif tag == 'iscsi': 7339 obj.iscsi = IscsiDetailsReader.read_one(reader) 7340 elif tag == 'katello_errata': 7341 obj.katello_errata = KatelloErratumReader.read_many(reader) 7342 elif tag == 'kdump_status': 7343 obj.kdump_status = Reader.read_enum(types.KdumpStatus, reader) 7344 elif tag == 'ksm': 7345 obj.ksm = KsmReader.read_one(reader) 7346 elif tag == 'libvirt_version': 7347 obj.libvirt_version = VersionReader.read_one(reader) 7348 elif tag == 'max_scheduling_memory': 7349 obj.max_scheduling_memory = Reader.read_integer(reader) 7350 elif tag == 'memory': 7351 obj.memory = Reader.read_integer(reader) 7352 elif tag == 'name': 7353 obj.name = Reader.read_string(reader) 7354 elif tag == 'network_attachments': 7355 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 7356 elif tag == 'network_operation_in_progress': 7357 obj.network_operation_in_progress = Reader.read_boolean(reader) 7358 elif tag == 'nics': 7359 obj.nics = HostNicReader.read_many(reader) 7360 elif tag == 'host_numa_nodes': 7361 obj.numa_nodes = NumaNodeReader.read_many(reader) 7362 elif tag == 'numa_supported': 7363 obj.numa_supported = Reader.read_boolean(reader) 7364 elif tag == 'os': 7365 obj.os = OperatingSystemReader.read_one(reader) 7366 elif tag == 'override_iptables': 7367 obj.override_iptables = Reader.read_boolean(reader) 7368 elif tag == 'ovn_configured': 7369 obj.ovn_configured = Reader.read_boolean(reader) 7370 elif tag == 'permissions': 7371 obj.permissions = PermissionReader.read_many(reader) 7372 elif tag == 'port': 7373 obj.port = Reader.read_integer(reader) 7374 elif tag == 'power_management': 7375 obj.power_management = PowerManagementReader.read_one(reader) 7376 elif tag == 'protocol': 7377 obj.protocol = Reader.read_enum(types.HostProtocol, reader) 7378 elif tag == 'reinstallation_required': 7379 obj.reinstallation_required = Reader.read_boolean(reader) 7380 elif tag == 'root_password': 7381 obj.root_password = Reader.read_string(reader) 7382 elif tag == 'se_linux': 7383 obj.se_linux = SeLinuxReader.read_one(reader) 7384 elif tag == 'spm': 7385 obj.spm = SpmReader.read_one(reader) 7386 elif tag == 'ssh': 7387 obj.ssh = SshReader.read_one(reader) 7388 elif tag == 'statistics': 7389 obj.statistics = StatisticReader.read_many(reader) 7390 elif tag == 'status': 7391 obj.status = Reader.read_enum(types.HostStatus, reader) 7392 elif tag == 'status_detail': 7393 obj.status_detail = Reader.read_string(reader) 7394 elif tag == 'storage_connection_extensions': 7395 obj.storage_connection_extensions = StorageConnectionExtensionReader.read_many(reader) 7396 elif tag == 'storages': 7397 obj.storages = HostStorageReader.read_many(reader) 7398 elif tag == 'summary': 7399 obj.summary = VmSummaryReader.read_one(reader) 7400 elif tag == 'tags': 7401 obj.tags = TagReader.read_many(reader) 7402 elif tag == 'transparent_hugepages': 7403 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 7404 elif tag == 'type': 7405 obj.type = Reader.read_enum(types.HostType, reader) 7406 elif tag == 'unmanaged_networks': 7407 obj.unmanaged_networks = UnmanagedNetworkReader.read_many(reader) 7408 elif tag == 'update_available': 7409 obj.update_available = Reader.read_boolean(reader) 7410 elif tag == 'version': 7411 obj.version = VersionReader.read_one(reader) 7412 elif tag == 'vgpu_placement': 7413 obj.vgpu_placement = Reader.read_enum(types.VgpuPlacement, reader) 7414 elif tag == 'link': 7415 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7416 reader.next_element() 7417 else: 7418 reader.next_element() 7419 for link in links: 7420 HostReader._process_link(link, obj) 7421 7422 # Discard the end tag: 7423 reader.read() 7424 7425 return obj 7426 7427 @staticmethod 7428 def read_many(reader): 7429 # Do nothing if there aren't more tags: 7430 objs = List() 7431 if not reader.forward(): 7432 return objs 7433 7434 # Process the attributes: 7435 objs.href = reader.get_attribute('href') 7436 7437 # Discard the start tag: 7438 empty = reader.empty_element() 7439 reader.read() 7440 if empty: 7441 return objs 7442 7443 # Process the inner elements: 7444 while reader.forward(): 7445 objs.append(HostReader.read_one(reader)) 7446 7447 # Discard the end tag: 7448 reader.read() 7449 7450 return objs 7451 7452 @staticmethod 7453 def _process_link(link, obj): 7454 # Process the attributes: 7455 rel = link[0] 7456 href = link[1] 7457 if href and rel: 7458 if rel == "affinitylabels": 7459 if obj.affinity_labels is not None: 7460 obj.affinity_labels.href = href 7461 else: 7462 obj.affinity_labels = List(href) 7463 elif rel == "agents": 7464 if obj.agents is not None: 7465 obj.agents.href = href 7466 else: 7467 obj.agents = List(href) 7468 elif rel == "cpuunits": 7469 if obj.cpu_units is not None: 7470 obj.cpu_units.href = href 7471 else: 7472 obj.cpu_units = List(href) 7473 elif rel == "devices": 7474 if obj.devices is not None: 7475 obj.devices.href = href 7476 else: 7477 obj.devices = List(href) 7478 elif rel == "externalnetworkproviderconfigurations": 7479 if obj.external_network_provider_configurations is not None: 7480 obj.external_network_provider_configurations.href = href 7481 else: 7482 obj.external_network_provider_configurations = List(href) 7483 elif rel == "hooks": 7484 if obj.hooks is not None: 7485 obj.hooks.href = href 7486 else: 7487 obj.hooks = List(href) 7488 elif rel == "katelloerrata": 7489 if obj.katello_errata is not None: 7490 obj.katello_errata.href = href 7491 else: 7492 obj.katello_errata = List(href) 7493 elif rel == "networkattachments": 7494 if obj.network_attachments is not None: 7495 obj.network_attachments.href = href 7496 else: 7497 obj.network_attachments = List(href) 7498 elif rel == "nics": 7499 if obj.nics is not None: 7500 obj.nics.href = href 7501 else: 7502 obj.nics = List(href) 7503 elif rel == "numanodes": 7504 if obj.numa_nodes is not None: 7505 obj.numa_nodes.href = href 7506 else: 7507 obj.numa_nodes = List(href) 7508 elif rel == "permissions": 7509 if obj.permissions is not None: 7510 obj.permissions.href = href 7511 else: 7512 obj.permissions = List(href) 7513 elif rel == "statistics": 7514 if obj.statistics is not None: 7515 obj.statistics.href = href 7516 else: 7517 obj.statistics = List(href) 7518 elif rel == "storageconnectionextensions": 7519 if obj.storage_connection_extensions is not None: 7520 obj.storage_connection_extensions.href = href 7521 else: 7522 obj.storage_connection_extensions = List(href) 7523 elif rel == "storages": 7524 if obj.storages is not None: 7525 obj.storages.href = href 7526 else: 7527 obj.storages = List(href) 7528 elif rel == "tags": 7529 if obj.tags is not None: 7530 obj.tags.href = href 7531 else: 7532 obj.tags = List(href) 7533 elif rel == "unmanagednetworks": 7534 if obj.unmanaged_networks is not None: 7535 obj.unmanaged_networks.href = href 7536 else: 7537 obj.unmanaged_networks = List(href) 7538 7539 7540class HostCpuUnitReader(Reader): 7541 7542 def __init__(self): 7543 super(HostCpuUnitReader, self).__init__() 7544 7545 @staticmethod 7546 def read_one(reader): 7547 # Do nothing if there aren't more tags: 7548 if not reader.forward(): 7549 return None 7550 7551 # Create the object: 7552 obj = types.HostCpuUnit() 7553 7554 # Process the attributes: 7555 obj.href = reader.get_attribute('href') 7556 value = reader.get_attribute('id') 7557 if value is not None: 7558 obj.id = value 7559 7560 # Discard the start tag: 7561 empty = reader.empty_element() 7562 reader.read() 7563 if empty: 7564 return obj 7565 7566 # Process the inner elements: 7567 links = [] 7568 while reader.forward(): 7569 tag = reader.node_name() 7570 if tag == 'comment': 7571 obj.comment = Reader.read_string(reader) 7572 elif tag == 'core_id': 7573 obj.core_id = Reader.read_integer(reader) 7574 elif tag == 'cpu_id': 7575 obj.cpu_id = Reader.read_integer(reader) 7576 elif tag == 'description': 7577 obj.description = Reader.read_string(reader) 7578 elif tag == 'name': 7579 obj.name = Reader.read_string(reader) 7580 elif tag == 'runs_vdsm': 7581 obj.runs_vdsm = Reader.read_boolean(reader) 7582 elif tag == 'socket_id': 7583 obj.socket_id = Reader.read_integer(reader) 7584 elif tag == 'vms': 7585 obj.vms = VmReader.read_many(reader) 7586 elif tag == 'link': 7587 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7588 reader.next_element() 7589 else: 7590 reader.next_element() 7591 for link in links: 7592 HostCpuUnitReader._process_link(link, obj) 7593 7594 # Discard the end tag: 7595 reader.read() 7596 7597 return obj 7598 7599 @staticmethod 7600 def read_many(reader): 7601 # Do nothing if there aren't more tags: 7602 objs = List() 7603 if not reader.forward(): 7604 return objs 7605 7606 # Process the attributes: 7607 objs.href = reader.get_attribute('href') 7608 7609 # Discard the start tag: 7610 empty = reader.empty_element() 7611 reader.read() 7612 if empty: 7613 return objs 7614 7615 # Process the inner elements: 7616 while reader.forward(): 7617 objs.append(HostCpuUnitReader.read_one(reader)) 7618 7619 # Discard the end tag: 7620 reader.read() 7621 7622 return objs 7623 7624 @staticmethod 7625 def _process_link(link, obj): 7626 # Process the attributes: 7627 rel = link[0] 7628 href = link[1] 7629 if href and rel: 7630 if rel == "vms": 7631 if obj.vms is not None: 7632 obj.vms.href = href 7633 else: 7634 obj.vms = List(href) 7635 7636 7637class HostDeviceReader(Reader): 7638 7639 def __init__(self): 7640 super(HostDeviceReader, self).__init__() 7641 7642 @staticmethod 7643 def read_one(reader): 7644 # Do nothing if there aren't more tags: 7645 if not reader.forward(): 7646 return None 7647 7648 # Create the object: 7649 obj = types.HostDevice() 7650 7651 # Process the attributes: 7652 obj.href = reader.get_attribute('href') 7653 value = reader.get_attribute('id') 7654 if value is not None: 7655 obj.id = value 7656 7657 # Discard the start tag: 7658 empty = reader.empty_element() 7659 reader.read() 7660 if empty: 7661 return obj 7662 7663 # Process the inner elements: 7664 links = [] 7665 while reader.forward(): 7666 tag = reader.node_name() 7667 if tag == 'capability': 7668 obj.capability = Reader.read_string(reader) 7669 elif tag == 'comment': 7670 obj.comment = Reader.read_string(reader) 7671 elif tag == 'description': 7672 obj.description = Reader.read_string(reader) 7673 elif tag == 'driver': 7674 obj.driver = Reader.read_string(reader) 7675 elif tag == 'host': 7676 obj.host = HostReader.read_one(reader) 7677 elif tag == 'iommu_group': 7678 obj.iommu_group = Reader.read_integer(reader) 7679 elif tag == 'm_dev_types': 7680 obj.m_dev_types = MDevTypeReader.read_many(reader) 7681 elif tag == 'name': 7682 obj.name = Reader.read_string(reader) 7683 elif tag == 'parent_device': 7684 obj.parent_device = HostDeviceReader.read_one(reader) 7685 elif tag == 'physical_function': 7686 obj.physical_function = HostDeviceReader.read_one(reader) 7687 elif tag == 'placeholder': 7688 obj.placeholder = Reader.read_boolean(reader) 7689 elif tag == 'product': 7690 obj.product = ProductReader.read_one(reader) 7691 elif tag == 'vendor': 7692 obj.vendor = VendorReader.read_one(reader) 7693 elif tag == 'virtual_functions': 7694 obj.virtual_functions = Reader.read_integer(reader) 7695 elif tag == 'vm': 7696 obj.vm = VmReader.read_one(reader) 7697 else: 7698 reader.next_element() 7699 for link in links: 7700 HostDeviceReader._process_link(link, obj) 7701 7702 # Discard the end tag: 7703 reader.read() 7704 7705 return obj 7706 7707 @staticmethod 7708 def read_many(reader): 7709 # Do nothing if there aren't more tags: 7710 objs = List() 7711 if not reader.forward(): 7712 return objs 7713 7714 # Process the attributes: 7715 objs.href = reader.get_attribute('href') 7716 7717 # Discard the start tag: 7718 empty = reader.empty_element() 7719 reader.read() 7720 if empty: 7721 return objs 7722 7723 # Process the inner elements: 7724 while reader.forward(): 7725 objs.append(HostDeviceReader.read_one(reader)) 7726 7727 # Discard the end tag: 7728 reader.read() 7729 7730 return objs 7731 7732 7733class HostDevicePassthroughReader(Reader): 7734 7735 def __init__(self): 7736 super(HostDevicePassthroughReader, self).__init__() 7737 7738 @staticmethod 7739 def read_one(reader): 7740 # Do nothing if there aren't more tags: 7741 if not reader.forward(): 7742 return None 7743 7744 # Create the object: 7745 obj = types.HostDevicePassthrough() 7746 7747 # Process the attributes: 7748 obj.href = reader.get_attribute('href') 7749 7750 # Discard the start tag: 7751 empty = reader.empty_element() 7752 reader.read() 7753 if empty: 7754 return obj 7755 7756 # Process the inner elements: 7757 links = [] 7758 while reader.forward(): 7759 tag = reader.node_name() 7760 if tag == 'enabled': 7761 obj.enabled = Reader.read_boolean(reader) 7762 else: 7763 reader.next_element() 7764 for link in links: 7765 HostDevicePassthroughReader._process_link(link, obj) 7766 7767 # Discard the end tag: 7768 reader.read() 7769 7770 return obj 7771 7772 @staticmethod 7773 def read_many(reader): 7774 # Do nothing if there aren't more tags: 7775 objs = List() 7776 if not reader.forward(): 7777 return objs 7778 7779 # Process the attributes: 7780 objs.href = reader.get_attribute('href') 7781 7782 # Discard the start tag: 7783 empty = reader.empty_element() 7784 reader.read() 7785 if empty: 7786 return objs 7787 7788 # Process the inner elements: 7789 while reader.forward(): 7790 objs.append(HostDevicePassthroughReader.read_one(reader)) 7791 7792 # Discard the end tag: 7793 reader.read() 7794 7795 return objs 7796 7797 7798class HostNicReader(Reader): 7799 7800 def __init__(self): 7801 super(HostNicReader, self).__init__() 7802 7803 @staticmethod 7804 def read_one(reader): 7805 # Do nothing if there aren't more tags: 7806 if not reader.forward(): 7807 return None 7808 7809 # Create the object: 7810 obj = types.HostNic() 7811 7812 # Process the attributes: 7813 obj.href = reader.get_attribute('href') 7814 value = reader.get_attribute('id') 7815 if value is not None: 7816 obj.id = value 7817 7818 # Discard the start tag: 7819 empty = reader.empty_element() 7820 reader.read() 7821 if empty: 7822 return obj 7823 7824 # Process the inner elements: 7825 links = [] 7826 while reader.forward(): 7827 tag = reader.node_name() 7828 if tag == 'ad_aggregator_id': 7829 obj.ad_aggregator_id = Reader.read_integer(reader) 7830 elif tag == 'base_interface': 7831 obj.base_interface = Reader.read_string(reader) 7832 elif tag == 'bonding': 7833 obj.bonding = BondingReader.read_one(reader) 7834 elif tag == 'boot_protocol': 7835 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7836 elif tag == 'bridged': 7837 obj.bridged = Reader.read_boolean(reader) 7838 elif tag == 'check_connectivity': 7839 obj.check_connectivity = Reader.read_boolean(reader) 7840 elif tag == 'comment': 7841 obj.comment = Reader.read_string(reader) 7842 elif tag == 'custom_configuration': 7843 obj.custom_configuration = Reader.read_boolean(reader) 7844 elif tag == 'description': 7845 obj.description = Reader.read_string(reader) 7846 elif tag == 'host': 7847 obj.host = HostReader.read_one(reader) 7848 elif tag == 'ip': 7849 obj.ip = IpReader.read_one(reader) 7850 elif tag == 'ipv6': 7851 obj.ipv6 = IpReader.read_one(reader) 7852 elif tag == 'ipv6_boot_protocol': 7853 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7854 elif tag == 'mac': 7855 obj.mac = MacReader.read_one(reader) 7856 elif tag == 'mtu': 7857 obj.mtu = Reader.read_integer(reader) 7858 elif tag == 'name': 7859 obj.name = Reader.read_string(reader) 7860 elif tag == 'network': 7861 obj.network = NetworkReader.read_one(reader) 7862 elif tag == 'network_labels': 7863 obj.network_labels = NetworkLabelReader.read_many(reader) 7864 elif tag == 'override_configuration': 7865 obj.override_configuration = Reader.read_boolean(reader) 7866 elif tag == 'physical_function': 7867 obj.physical_function = HostNicReader.read_one(reader) 7868 elif tag == 'properties': 7869 obj.properties = PropertyReader.read_many(reader) 7870 elif tag == 'qos': 7871 obj.qos = QosReader.read_one(reader) 7872 elif tag == 'speed': 7873 obj.speed = Reader.read_integer(reader) 7874 elif tag == 'statistics': 7875 obj.statistics = StatisticReader.read_many(reader) 7876 elif tag == 'status': 7877 obj.status = Reader.read_enum(types.NicStatus, reader) 7878 elif tag == 'virtual_functions_configuration': 7879 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 7880 elif tag == 'vlan': 7881 obj.vlan = VlanReader.read_one(reader) 7882 elif tag == 'link': 7883 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7884 reader.next_element() 7885 else: 7886 reader.next_element() 7887 for link in links: 7888 HostNicReader._process_link(link, obj) 7889 7890 # Discard the end tag: 7891 reader.read() 7892 7893 return obj 7894 7895 @staticmethod 7896 def read_many(reader): 7897 # Do nothing if there aren't more tags: 7898 objs = List() 7899 if not reader.forward(): 7900 return objs 7901 7902 # Process the attributes: 7903 objs.href = reader.get_attribute('href') 7904 7905 # Discard the start tag: 7906 empty = reader.empty_element() 7907 reader.read() 7908 if empty: 7909 return objs 7910 7911 # Process the inner elements: 7912 while reader.forward(): 7913 objs.append(HostNicReader.read_one(reader)) 7914 7915 # Discard the end tag: 7916 reader.read() 7917 7918 return objs 7919 7920 @staticmethod 7921 def _process_link(link, obj): 7922 # Process the attributes: 7923 rel = link[0] 7924 href = link[1] 7925 if href and rel: 7926 if rel == "networklabels": 7927 if obj.network_labels is not None: 7928 obj.network_labels.href = href 7929 else: 7930 obj.network_labels = List(href) 7931 elif rel == "statistics": 7932 if obj.statistics is not None: 7933 obj.statistics.href = href 7934 else: 7935 obj.statistics = List(href) 7936 7937 7938class HostNicVirtualFunctionsConfigurationReader(Reader): 7939 7940 def __init__(self): 7941 super(HostNicVirtualFunctionsConfigurationReader, self).__init__() 7942 7943 @staticmethod 7944 def read_one(reader): 7945 # Do nothing if there aren't more tags: 7946 if not reader.forward(): 7947 return None 7948 7949 # Create the object: 7950 obj = types.HostNicVirtualFunctionsConfiguration() 7951 7952 # Process the attributes: 7953 obj.href = reader.get_attribute('href') 7954 7955 # Discard the start tag: 7956 empty = reader.empty_element() 7957 reader.read() 7958 if empty: 7959 return obj 7960 7961 # Process the inner elements: 7962 links = [] 7963 while reader.forward(): 7964 tag = reader.node_name() 7965 if tag == 'all_networks_allowed': 7966 obj.all_networks_allowed = Reader.read_boolean(reader) 7967 elif tag == 'max_number_of_virtual_functions': 7968 obj.max_number_of_virtual_functions = Reader.read_integer(reader) 7969 elif tag == 'number_of_virtual_functions': 7970 obj.number_of_virtual_functions = Reader.read_integer(reader) 7971 else: 7972 reader.next_element() 7973 for link in links: 7974 HostNicVirtualFunctionsConfigurationReader._process_link(link, obj) 7975 7976 # Discard the end tag: 7977 reader.read() 7978 7979 return obj 7980 7981 @staticmethod 7982 def read_many(reader): 7983 # Do nothing if there aren't more tags: 7984 objs = List() 7985 if not reader.forward(): 7986 return objs 7987 7988 # Process the attributes: 7989 objs.href = reader.get_attribute('href') 7990 7991 # Discard the start tag: 7992 empty = reader.empty_element() 7993 reader.read() 7994 if empty: 7995 return objs 7996 7997 # Process the inner elements: 7998 while reader.forward(): 7999 objs.append(HostNicVirtualFunctionsConfigurationReader.read_one(reader)) 8000 8001 # Discard the end tag: 8002 reader.read() 8003 8004 return objs 8005 8006 8007class HostStorageReader(Reader): 8008 8009 def __init__(self): 8010 super(HostStorageReader, self).__init__() 8011 8012 @staticmethod 8013 def read_one(reader): 8014 # Do nothing if there aren't more tags: 8015 if not reader.forward(): 8016 return None 8017 8018 # Create the object: 8019 obj = types.HostStorage() 8020 8021 # Process the attributes: 8022 obj.href = reader.get_attribute('href') 8023 value = reader.get_attribute('id') 8024 if value is not None: 8025 obj.id = value 8026 8027 # Discard the start tag: 8028 empty = reader.empty_element() 8029 reader.read() 8030 if empty: 8031 return obj 8032 8033 # Process the inner elements: 8034 links = [] 8035 while reader.forward(): 8036 tag = reader.node_name() 8037 if tag == 'address': 8038 obj.address = Reader.read_string(reader) 8039 elif tag == 'comment': 8040 obj.comment = Reader.read_string(reader) 8041 elif tag == 'description': 8042 obj.description = Reader.read_string(reader) 8043 elif tag == 'driver_options': 8044 obj.driver_options = PropertyReader.read_many(reader) 8045 elif tag == 'driver_sensitive_options': 8046 obj.driver_sensitive_options = PropertyReader.read_many(reader) 8047 elif tag == 'host': 8048 obj.host = HostReader.read_one(reader) 8049 elif tag == 'logical_units': 8050 obj.logical_units = LogicalUnitReader.read_many(reader) 8051 elif tag == 'mount_options': 8052 obj.mount_options = Reader.read_string(reader) 8053 elif tag == 'name': 8054 obj.name = Reader.read_string(reader) 8055 elif tag == 'nfs_retrans': 8056 obj.nfs_retrans = Reader.read_integer(reader) 8057 elif tag == 'nfs_timeo': 8058 obj.nfs_timeo = Reader.read_integer(reader) 8059 elif tag == 'nfs_version': 8060 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 8061 elif tag == 'override_luns': 8062 obj.override_luns = Reader.read_boolean(reader) 8063 elif tag == 'password': 8064 obj.password = Reader.read_string(reader) 8065 elif tag == 'path': 8066 obj.path = Reader.read_string(reader) 8067 elif tag == 'port': 8068 obj.port = Reader.read_integer(reader) 8069 elif tag == 'portal': 8070 obj.portal = Reader.read_string(reader) 8071 elif tag == 'target': 8072 obj.target = Reader.read_string(reader) 8073 elif tag == 'type': 8074 obj.type = Reader.read_enum(types.StorageType, reader) 8075 elif tag == 'username': 8076 obj.username = Reader.read_string(reader) 8077 elif tag == 'vfs_type': 8078 obj.vfs_type = Reader.read_string(reader) 8079 elif tag == 'volume_group': 8080 obj.volume_group = VolumeGroupReader.read_one(reader) 8081 else: 8082 reader.next_element() 8083 for link in links: 8084 HostStorageReader._process_link(link, obj) 8085 8086 # Discard the end tag: 8087 reader.read() 8088 8089 return obj 8090 8091 @staticmethod 8092 def read_many(reader): 8093 # Do nothing if there aren't more tags: 8094 objs = List() 8095 if not reader.forward(): 8096 return objs 8097 8098 # Process the attributes: 8099 objs.href = reader.get_attribute('href') 8100 8101 # Discard the start tag: 8102 empty = reader.empty_element() 8103 reader.read() 8104 if empty: 8105 return objs 8106 8107 # Process the inner elements: 8108 while reader.forward(): 8109 objs.append(HostStorageReader.read_one(reader)) 8110 8111 # Discard the end tag: 8112 reader.read() 8113 8114 return objs 8115 8116 8117class HostedEngineReader(Reader): 8118 8119 def __init__(self): 8120 super(HostedEngineReader, self).__init__() 8121 8122 @staticmethod 8123 def read_one(reader): 8124 # Do nothing if there aren't more tags: 8125 if not reader.forward(): 8126 return None 8127 8128 # Create the object: 8129 obj = types.HostedEngine() 8130 8131 # Process the attributes: 8132 obj.href = reader.get_attribute('href') 8133 8134 # Discard the start tag: 8135 empty = reader.empty_element() 8136 reader.read() 8137 if empty: 8138 return obj 8139 8140 # Process the inner elements: 8141 links = [] 8142 while reader.forward(): 8143 tag = reader.node_name() 8144 if tag == 'active': 8145 obj.active = Reader.read_boolean(reader) 8146 elif tag == 'configured': 8147 obj.configured = Reader.read_boolean(reader) 8148 elif tag == 'global_maintenance': 8149 obj.global_maintenance = Reader.read_boolean(reader) 8150 elif tag == 'local_maintenance': 8151 obj.local_maintenance = Reader.read_boolean(reader) 8152 elif tag == 'score': 8153 obj.score = Reader.read_integer(reader) 8154 else: 8155 reader.next_element() 8156 for link in links: 8157 HostedEngineReader._process_link(link, obj) 8158 8159 # Discard the end tag: 8160 reader.read() 8161 8162 return obj 8163 8164 @staticmethod 8165 def read_many(reader): 8166 # Do nothing if there aren't more tags: 8167 objs = List() 8168 if not reader.forward(): 8169 return objs 8170 8171 # Process the attributes: 8172 objs.href = reader.get_attribute('href') 8173 8174 # Discard the start tag: 8175 empty = reader.empty_element() 8176 reader.read() 8177 if empty: 8178 return objs 8179 8180 # Process the inner elements: 8181 while reader.forward(): 8182 objs.append(HostedEngineReader.read_one(reader)) 8183 8184 # Discard the end tag: 8185 reader.read() 8186 8187 return objs 8188 8189 8190class IconReader(Reader): 8191 8192 def __init__(self): 8193 super(IconReader, self).__init__() 8194 8195 @staticmethod 8196 def read_one(reader): 8197 # Do nothing if there aren't more tags: 8198 if not reader.forward(): 8199 return None 8200 8201 # Create the object: 8202 obj = types.Icon() 8203 8204 # Process the attributes: 8205 obj.href = reader.get_attribute('href') 8206 value = reader.get_attribute('id') 8207 if value is not None: 8208 obj.id = value 8209 8210 # Discard the start tag: 8211 empty = reader.empty_element() 8212 reader.read() 8213 if empty: 8214 return obj 8215 8216 # Process the inner elements: 8217 links = [] 8218 while reader.forward(): 8219 tag = reader.node_name() 8220 if tag == 'comment': 8221 obj.comment = Reader.read_string(reader) 8222 elif tag == 'data': 8223 obj.data = Reader.read_string(reader) 8224 elif tag == 'description': 8225 obj.description = Reader.read_string(reader) 8226 elif tag == 'media_type': 8227 obj.media_type = Reader.read_string(reader) 8228 elif tag == 'name': 8229 obj.name = Reader.read_string(reader) 8230 else: 8231 reader.next_element() 8232 for link in links: 8233 IconReader._process_link(link, obj) 8234 8235 # Discard the end tag: 8236 reader.read() 8237 8238 return obj 8239 8240 @staticmethod 8241 def read_many(reader): 8242 # Do nothing if there aren't more tags: 8243 objs = List() 8244 if not reader.forward(): 8245 return objs 8246 8247 # Process the attributes: 8248 objs.href = reader.get_attribute('href') 8249 8250 # Discard the start tag: 8251 empty = reader.empty_element() 8252 reader.read() 8253 if empty: 8254 return objs 8255 8256 # Process the inner elements: 8257 while reader.forward(): 8258 objs.append(IconReader.read_one(reader)) 8259 8260 # Discard the end tag: 8261 reader.read() 8262 8263 return objs 8264 8265 8266class IdentifiedReader(Reader): 8267 8268 def __init__(self): 8269 super(IdentifiedReader, self).__init__() 8270 8271 @staticmethod 8272 def read_one(reader): 8273 # Do nothing if there aren't more tags: 8274 if not reader.forward(): 8275 return None 8276 8277 # Create the object: 8278 obj = types.Identified() 8279 8280 # Process the attributes: 8281 obj.href = reader.get_attribute('href') 8282 value = reader.get_attribute('id') 8283 if value is not None: 8284 obj.id = value 8285 8286 # Discard the start tag: 8287 empty = reader.empty_element() 8288 reader.read() 8289 if empty: 8290 return obj 8291 8292 # Process the inner elements: 8293 links = [] 8294 while reader.forward(): 8295 tag = reader.node_name() 8296 if tag == 'comment': 8297 obj.comment = Reader.read_string(reader) 8298 elif tag == 'description': 8299 obj.description = Reader.read_string(reader) 8300 elif tag == 'name': 8301 obj.name = Reader.read_string(reader) 8302 else: 8303 reader.next_element() 8304 for link in links: 8305 IdentifiedReader._process_link(link, obj) 8306 8307 # Discard the end tag: 8308 reader.read() 8309 8310 return obj 8311 8312 @staticmethod 8313 def read_many(reader): 8314 # Do nothing if there aren't more tags: 8315 objs = List() 8316 if not reader.forward(): 8317 return objs 8318 8319 # Process the attributes: 8320 objs.href = reader.get_attribute('href') 8321 8322 # Discard the start tag: 8323 empty = reader.empty_element() 8324 reader.read() 8325 if empty: 8326 return objs 8327 8328 # Process the inner elements: 8329 while reader.forward(): 8330 objs.append(IdentifiedReader.read_one(reader)) 8331 8332 # Discard the end tag: 8333 reader.read() 8334 8335 return objs 8336 8337 8338class ImageReader(Reader): 8339 8340 def __init__(self): 8341 super(ImageReader, self).__init__() 8342 8343 @staticmethod 8344 def read_one(reader): 8345 # Do nothing if there aren't more tags: 8346 if not reader.forward(): 8347 return None 8348 8349 # Create the object: 8350 obj = types.Image() 8351 8352 # Process the attributes: 8353 obj.href = reader.get_attribute('href') 8354 value = reader.get_attribute('id') 8355 if value is not None: 8356 obj.id = value 8357 8358 # Discard the start tag: 8359 empty = reader.empty_element() 8360 reader.read() 8361 if empty: 8362 return obj 8363 8364 # Process the inner elements: 8365 links = [] 8366 while reader.forward(): 8367 tag = reader.node_name() 8368 if tag == 'comment': 8369 obj.comment = Reader.read_string(reader) 8370 elif tag == 'description': 8371 obj.description = Reader.read_string(reader) 8372 elif tag == 'name': 8373 obj.name = Reader.read_string(reader) 8374 elif tag == 'size': 8375 obj.size = Reader.read_integer(reader) 8376 elif tag == 'storage_domain': 8377 obj.storage_domain = StorageDomainReader.read_one(reader) 8378 elif tag == 'type': 8379 obj.type = Reader.read_enum(types.ImageFileType, reader) 8380 else: 8381 reader.next_element() 8382 for link in links: 8383 ImageReader._process_link(link, obj) 8384 8385 # Discard the end tag: 8386 reader.read() 8387 8388 return obj 8389 8390 @staticmethod 8391 def read_many(reader): 8392 # Do nothing if there aren't more tags: 8393 objs = List() 8394 if not reader.forward(): 8395 return objs 8396 8397 # Process the attributes: 8398 objs.href = reader.get_attribute('href') 8399 8400 # Discard the start tag: 8401 empty = reader.empty_element() 8402 reader.read() 8403 if empty: 8404 return objs 8405 8406 # Process the inner elements: 8407 while reader.forward(): 8408 objs.append(ImageReader.read_one(reader)) 8409 8410 # Discard the end tag: 8411 reader.read() 8412 8413 return objs 8414 8415 8416class ImageTransferReader(Reader): 8417 8418 def __init__(self): 8419 super(ImageTransferReader, self).__init__() 8420 8421 @staticmethod 8422 def read_one(reader): 8423 # Do nothing if there aren't more tags: 8424 if not reader.forward(): 8425 return None 8426 8427 # Create the object: 8428 obj = types.ImageTransfer() 8429 8430 # Process the attributes: 8431 obj.href = reader.get_attribute('href') 8432 value = reader.get_attribute('id') 8433 if value is not None: 8434 obj.id = value 8435 8436 # Discard the start tag: 8437 empty = reader.empty_element() 8438 reader.read() 8439 if empty: 8440 return obj 8441 8442 # Process the inner elements: 8443 links = [] 8444 while reader.forward(): 8445 tag = reader.node_name() 8446 if tag == 'active': 8447 obj.active = Reader.read_boolean(reader) 8448 elif tag == 'backup': 8449 obj.backup = BackupReader.read_one(reader) 8450 elif tag == 'comment': 8451 obj.comment = Reader.read_string(reader) 8452 elif tag == 'description': 8453 obj.description = Reader.read_string(reader) 8454 elif tag == 'direction': 8455 obj.direction = Reader.read_enum(types.ImageTransferDirection, reader) 8456 elif tag == 'disk': 8457 obj.disk = DiskReader.read_one(reader) 8458 elif tag == 'format': 8459 obj.format = Reader.read_enum(types.DiskFormat, reader) 8460 elif tag == 'host': 8461 obj.host = HostReader.read_one(reader) 8462 elif tag == 'image': 8463 obj.image = ImageReader.read_one(reader) 8464 elif tag == 'inactivity_timeout': 8465 obj.inactivity_timeout = Reader.read_integer(reader) 8466 elif tag == 'name': 8467 obj.name = Reader.read_string(reader) 8468 elif tag == 'phase': 8469 obj.phase = Reader.read_enum(types.ImageTransferPhase, reader) 8470 elif tag == 'proxy_url': 8471 obj.proxy_url = Reader.read_string(reader) 8472 elif tag == 'shallow': 8473 obj.shallow = Reader.read_boolean(reader) 8474 elif tag == 'snapshot': 8475 obj.snapshot = DiskSnapshotReader.read_one(reader) 8476 elif tag == 'timeout_policy': 8477 obj.timeout_policy = Reader.read_enum(types.ImageTransferTimeoutPolicy, reader) 8478 elif tag == 'transfer_url': 8479 obj.transfer_url = Reader.read_string(reader) 8480 elif tag == 'transferred': 8481 obj.transferred = Reader.read_integer(reader) 8482 else: 8483 reader.next_element() 8484 for link in links: 8485 ImageTransferReader._process_link(link, obj) 8486 8487 # Discard the end tag: 8488 reader.read() 8489 8490 return obj 8491 8492 @staticmethod 8493 def read_many(reader): 8494 # Do nothing if there aren't more tags: 8495 objs = List() 8496 if not reader.forward(): 8497 return objs 8498 8499 # Process the attributes: 8500 objs.href = reader.get_attribute('href') 8501 8502 # Discard the start tag: 8503 empty = reader.empty_element() 8504 reader.read() 8505 if empty: 8506 return objs 8507 8508 # Process the inner elements: 8509 while reader.forward(): 8510 objs.append(ImageTransferReader.read_one(reader)) 8511 8512 # Discard the end tag: 8513 reader.read() 8514 8515 return objs 8516 8517 8518class InitializationReader(Reader): 8519 8520 def __init__(self): 8521 super(InitializationReader, self).__init__() 8522 8523 @staticmethod 8524 def read_one(reader): 8525 # Do nothing if there aren't more tags: 8526 if not reader.forward(): 8527 return None 8528 8529 # Create the object: 8530 obj = types.Initialization() 8531 8532 # Process the attributes: 8533 obj.href = reader.get_attribute('href') 8534 8535 # Discard the start tag: 8536 empty = reader.empty_element() 8537 reader.read() 8538 if empty: 8539 return obj 8540 8541 # Process the inner elements: 8542 links = [] 8543 while reader.forward(): 8544 tag = reader.node_name() 8545 if tag == 'active_directory_ou': 8546 obj.active_directory_ou = Reader.read_string(reader) 8547 elif tag == 'authorized_ssh_keys': 8548 obj.authorized_ssh_keys = Reader.read_string(reader) 8549 elif tag == 'cloud_init': 8550 obj.cloud_init = CloudInitReader.read_one(reader) 8551 elif tag == 'cloud_init_network_protocol': 8552 obj.cloud_init_network_protocol = Reader.read_enum(types.CloudInitNetworkProtocol, reader) 8553 elif tag == 'configuration': 8554 obj.configuration = ConfigurationReader.read_one(reader) 8555 elif tag == 'custom_script': 8556 obj.custom_script = Reader.read_string(reader) 8557 elif tag == 'dns_search': 8558 obj.dns_search = Reader.read_string(reader) 8559 elif tag == 'dns_servers': 8560 obj.dns_servers = Reader.read_string(reader) 8561 elif tag == 'domain': 8562 obj.domain = Reader.read_string(reader) 8563 elif tag == 'host_name': 8564 obj.host_name = Reader.read_string(reader) 8565 elif tag == 'input_locale': 8566 obj.input_locale = Reader.read_string(reader) 8567 elif tag == 'nic_configurations': 8568 obj.nic_configurations = NicConfigurationReader.read_many(reader) 8569 elif tag == 'org_name': 8570 obj.org_name = Reader.read_string(reader) 8571 elif tag == 'regenerate_ids': 8572 obj.regenerate_ids = Reader.read_boolean(reader) 8573 elif tag == 'regenerate_ssh_keys': 8574 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 8575 elif tag == 'root_password': 8576 obj.root_password = Reader.read_string(reader) 8577 elif tag == 'system_locale': 8578 obj.system_locale = Reader.read_string(reader) 8579 elif tag == 'timezone': 8580 obj.timezone = Reader.read_string(reader) 8581 elif tag == 'ui_language': 8582 obj.ui_language = Reader.read_string(reader) 8583 elif tag == 'user_locale': 8584 obj.user_locale = Reader.read_string(reader) 8585 elif tag == 'user_name': 8586 obj.user_name = Reader.read_string(reader) 8587 elif tag == 'windows_license_key': 8588 obj.windows_license_key = Reader.read_string(reader) 8589 else: 8590 reader.next_element() 8591 for link in links: 8592 InitializationReader._process_link(link, obj) 8593 8594 # Discard the end tag: 8595 reader.read() 8596 8597 return obj 8598 8599 @staticmethod 8600 def read_many(reader): 8601 # Do nothing if there aren't more tags: 8602 objs = List() 8603 if not reader.forward(): 8604 return objs 8605 8606 # Process the attributes: 8607 objs.href = reader.get_attribute('href') 8608 8609 # Discard the start tag: 8610 empty = reader.empty_element() 8611 reader.read() 8612 if empty: 8613 return objs 8614 8615 # Process the inner elements: 8616 while reader.forward(): 8617 objs.append(InitializationReader.read_one(reader)) 8618 8619 # Discard the end tag: 8620 reader.read() 8621 8622 return objs 8623 8624 8625class InstanceTypeReader(Reader): 8626 8627 def __init__(self): 8628 super(InstanceTypeReader, self).__init__() 8629 8630 @staticmethod 8631 def read_one(reader): 8632 # Do nothing if there aren't more tags: 8633 if not reader.forward(): 8634 return None 8635 8636 # Create the object: 8637 obj = types.InstanceType() 8638 8639 # Process the attributes: 8640 obj.href = reader.get_attribute('href') 8641 value = reader.get_attribute('id') 8642 if value is not None: 8643 obj.id = value 8644 8645 # Discard the start tag: 8646 empty = reader.empty_element() 8647 reader.read() 8648 if empty: 8649 return obj 8650 8651 # Process the inner elements: 8652 links = [] 8653 while reader.forward(): 8654 tag = reader.node_name() 8655 if tag == 'auto_pinning_policy': 8656 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 8657 elif tag == 'bios': 8658 obj.bios = BiosReader.read_one(reader) 8659 elif tag == 'cdroms': 8660 obj.cdroms = CdromReader.read_many(reader) 8661 elif tag == 'cluster': 8662 obj.cluster = ClusterReader.read_one(reader) 8663 elif tag == 'comment': 8664 obj.comment = Reader.read_string(reader) 8665 elif tag == 'console': 8666 obj.console = ConsoleReader.read_one(reader) 8667 elif tag == 'cpu': 8668 obj.cpu = CpuReader.read_one(reader) 8669 elif tag == 'cpu_pinning_policy': 8670 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 8671 elif tag == 'cpu_profile': 8672 obj.cpu_profile = CpuProfileReader.read_one(reader) 8673 elif tag == 'cpu_shares': 8674 obj.cpu_shares = Reader.read_integer(reader) 8675 elif tag == 'creation_time': 8676 obj.creation_time = Reader.read_date(reader) 8677 elif tag == 'custom_compatibility_version': 8678 obj.custom_compatibility_version = VersionReader.read_one(reader) 8679 elif tag == 'custom_cpu_model': 8680 obj.custom_cpu_model = Reader.read_string(reader) 8681 elif tag == 'custom_emulated_machine': 8682 obj.custom_emulated_machine = Reader.read_string(reader) 8683 elif tag == 'custom_properties': 8684 obj.custom_properties = CustomPropertyReader.read_many(reader) 8685 elif tag == 'delete_protected': 8686 obj.delete_protected = Reader.read_boolean(reader) 8687 elif tag == 'description': 8688 obj.description = Reader.read_string(reader) 8689 elif tag == 'disk_attachments': 8690 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 8691 elif tag == 'display': 8692 obj.display = DisplayReader.read_one(reader) 8693 elif tag == 'domain': 8694 obj.domain = DomainReader.read_one(reader) 8695 elif tag == 'graphics_consoles': 8696 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 8697 elif tag == 'high_availability': 8698 obj.high_availability = HighAvailabilityReader.read_one(reader) 8699 elif tag == 'initialization': 8700 obj.initialization = InitializationReader.read_one(reader) 8701 elif tag == 'io': 8702 obj.io = IoReader.read_one(reader) 8703 elif tag == 'large_icon': 8704 obj.large_icon = IconReader.read_one(reader) 8705 elif tag == 'lease': 8706 obj.lease = StorageDomainLeaseReader.read_one(reader) 8707 elif tag == 'mediated_devices': 8708 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 8709 elif tag == 'memory': 8710 obj.memory = Reader.read_integer(reader) 8711 elif tag == 'memory_policy': 8712 obj.memory_policy = MemoryPolicyReader.read_one(reader) 8713 elif tag == 'migration': 8714 obj.migration = MigrationOptionsReader.read_one(reader) 8715 elif tag == 'migration_downtime': 8716 obj.migration_downtime = Reader.read_integer(reader) 8717 elif tag == 'multi_queues_enabled': 8718 obj.multi_queues_enabled = Reader.read_boolean(reader) 8719 elif tag == 'name': 8720 obj.name = Reader.read_string(reader) 8721 elif tag == 'nics': 8722 obj.nics = NicReader.read_many(reader) 8723 elif tag == 'origin': 8724 obj.origin = Reader.read_string(reader) 8725 elif tag == 'os': 8726 obj.os = OperatingSystemReader.read_one(reader) 8727 elif tag == 'permissions': 8728 obj.permissions = PermissionReader.read_many(reader) 8729 elif tag == 'placement_policy': 8730 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 8731 elif tag == 'quota': 8732 obj.quota = QuotaReader.read_one(reader) 8733 elif tag == 'rng_device': 8734 obj.rng_device = RngDeviceReader.read_one(reader) 8735 elif tag == 'serial_number': 8736 obj.serial_number = SerialNumberReader.read_one(reader) 8737 elif tag == 'small_icon': 8738 obj.small_icon = IconReader.read_one(reader) 8739 elif tag == 'soundcard_enabled': 8740 obj.soundcard_enabled = Reader.read_boolean(reader) 8741 elif tag == 'sso': 8742 obj.sso = SsoReader.read_one(reader) 8743 elif tag == 'start_paused': 8744 obj.start_paused = Reader.read_boolean(reader) 8745 elif tag == 'stateless': 8746 obj.stateless = Reader.read_boolean(reader) 8747 elif tag == 'status': 8748 obj.status = Reader.read_enum(types.TemplateStatus, reader) 8749 elif tag == 'storage_domain': 8750 obj.storage_domain = StorageDomainReader.read_one(reader) 8751 elif tag == 'storage_error_resume_behaviour': 8752 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 8753 elif tag == 'tags': 8754 obj.tags = TagReader.read_many(reader) 8755 elif tag == 'time_zone': 8756 obj.time_zone = TimeZoneReader.read_one(reader) 8757 elif tag == 'tpm_enabled': 8758 obj.tpm_enabled = Reader.read_boolean(reader) 8759 elif tag == 'tunnel_migration': 8760 obj.tunnel_migration = Reader.read_boolean(reader) 8761 elif tag == 'type': 8762 obj.type = Reader.read_enum(types.VmType, reader) 8763 elif tag == 'usb': 8764 obj.usb = UsbReader.read_one(reader) 8765 elif tag == 'version': 8766 obj.version = TemplateVersionReader.read_one(reader) 8767 elif tag == 'virtio_scsi': 8768 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 8769 elif tag == 'virtio_scsi_multi_queues': 8770 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 8771 elif tag == 'virtio_scsi_multi_queues_enabled': 8772 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 8773 elif tag == 'vm': 8774 obj.vm = VmReader.read_one(reader) 8775 elif tag == 'watchdogs': 8776 obj.watchdogs = WatchdogReader.read_many(reader) 8777 elif tag == 'link': 8778 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 8779 reader.next_element() 8780 else: 8781 reader.next_element() 8782 for link in links: 8783 InstanceTypeReader._process_link(link, obj) 8784 8785 # Discard the end tag: 8786 reader.read() 8787 8788 return obj 8789 8790 @staticmethod 8791 def read_many(reader): 8792 # Do nothing if there aren't more tags: 8793 objs = List() 8794 if not reader.forward(): 8795 return objs 8796 8797 # Process the attributes: 8798 objs.href = reader.get_attribute('href') 8799 8800 # Discard the start tag: 8801 empty = reader.empty_element() 8802 reader.read() 8803 if empty: 8804 return objs 8805 8806 # Process the inner elements: 8807 while reader.forward(): 8808 objs.append(InstanceTypeReader.read_one(reader)) 8809 8810 # Discard the end tag: 8811 reader.read() 8812 8813 return objs 8814 8815 @staticmethod 8816 def _process_link(link, obj): 8817 # Process the attributes: 8818 rel = link[0] 8819 href = link[1] 8820 if href and rel: 8821 if rel == "cdroms": 8822 if obj.cdroms is not None: 8823 obj.cdroms.href = href 8824 else: 8825 obj.cdroms = List(href) 8826 elif rel == "diskattachments": 8827 if obj.disk_attachments is not None: 8828 obj.disk_attachments.href = href 8829 else: 8830 obj.disk_attachments = List(href) 8831 elif rel == "graphicsconsoles": 8832 if obj.graphics_consoles is not None: 8833 obj.graphics_consoles.href = href 8834 else: 8835 obj.graphics_consoles = List(href) 8836 elif rel == "mediateddevices": 8837 if obj.mediated_devices is not None: 8838 obj.mediated_devices.href = href 8839 else: 8840 obj.mediated_devices = List(href) 8841 elif rel == "nics": 8842 if obj.nics is not None: 8843 obj.nics.href = href 8844 else: 8845 obj.nics = List(href) 8846 elif rel == "permissions": 8847 if obj.permissions is not None: 8848 obj.permissions.href = href 8849 else: 8850 obj.permissions = List(href) 8851 elif rel == "tags": 8852 if obj.tags is not None: 8853 obj.tags.href = href 8854 else: 8855 obj.tags = List(href) 8856 elif rel == "watchdogs": 8857 if obj.watchdogs is not None: 8858 obj.watchdogs.href = href 8859 else: 8860 obj.watchdogs = List(href) 8861 8862 8863class IoReader(Reader): 8864 8865 def __init__(self): 8866 super(IoReader, self).__init__() 8867 8868 @staticmethod 8869 def read_one(reader): 8870 # Do nothing if there aren't more tags: 8871 if not reader.forward(): 8872 return None 8873 8874 # Create the object: 8875 obj = types.Io() 8876 8877 # Process the attributes: 8878 obj.href = reader.get_attribute('href') 8879 8880 # Discard the start tag: 8881 empty = reader.empty_element() 8882 reader.read() 8883 if empty: 8884 return obj 8885 8886 # Process the inner elements: 8887 links = [] 8888 while reader.forward(): 8889 tag = reader.node_name() 8890 if tag == 'threads': 8891 obj.threads = Reader.read_integer(reader) 8892 else: 8893 reader.next_element() 8894 for link in links: 8895 IoReader._process_link(link, obj) 8896 8897 # Discard the end tag: 8898 reader.read() 8899 8900 return obj 8901 8902 @staticmethod 8903 def read_many(reader): 8904 # Do nothing if there aren't more tags: 8905 objs = List() 8906 if not reader.forward(): 8907 return objs 8908 8909 # Process the attributes: 8910 objs.href = reader.get_attribute('href') 8911 8912 # Discard the start tag: 8913 empty = reader.empty_element() 8914 reader.read() 8915 if empty: 8916 return objs 8917 8918 # Process the inner elements: 8919 while reader.forward(): 8920 objs.append(IoReader.read_one(reader)) 8921 8922 # Discard the end tag: 8923 reader.read() 8924 8925 return objs 8926 8927 8928class IpReader(Reader): 8929 8930 def __init__(self): 8931 super(IpReader, self).__init__() 8932 8933 @staticmethod 8934 def read_one(reader): 8935 # Do nothing if there aren't more tags: 8936 if not reader.forward(): 8937 return None 8938 8939 # Create the object: 8940 obj = types.Ip() 8941 8942 # Process the attributes: 8943 obj.href = reader.get_attribute('href') 8944 8945 # Discard the start tag: 8946 empty = reader.empty_element() 8947 reader.read() 8948 if empty: 8949 return obj 8950 8951 # Process the inner elements: 8952 links = [] 8953 while reader.forward(): 8954 tag = reader.node_name() 8955 if tag == 'address': 8956 obj.address = Reader.read_string(reader) 8957 elif tag == 'gateway': 8958 obj.gateway = Reader.read_string(reader) 8959 elif tag == 'netmask': 8960 obj.netmask = Reader.read_string(reader) 8961 elif tag == 'version': 8962 obj.version = Reader.read_enum(types.IpVersion, reader) 8963 else: 8964 reader.next_element() 8965 for link in links: 8966 IpReader._process_link(link, obj) 8967 8968 # Discard the end tag: 8969 reader.read() 8970 8971 return obj 8972 8973 @staticmethod 8974 def read_many(reader): 8975 # Do nothing if there aren't more tags: 8976 objs = List() 8977 if not reader.forward(): 8978 return objs 8979 8980 # Process the attributes: 8981 objs.href = reader.get_attribute('href') 8982 8983 # Discard the start tag: 8984 empty = reader.empty_element() 8985 reader.read() 8986 if empty: 8987 return objs 8988 8989 # Process the inner elements: 8990 while reader.forward(): 8991 objs.append(IpReader.read_one(reader)) 8992 8993 # Discard the end tag: 8994 reader.read() 8995 8996 return objs 8997 8998 8999class IpAddressAssignmentReader(Reader): 9000 9001 def __init__(self): 9002 super(IpAddressAssignmentReader, self).__init__() 9003 9004 @staticmethod 9005 def read_one(reader): 9006 # Do nothing if there aren't more tags: 9007 if not reader.forward(): 9008 return None 9009 9010 # Create the object: 9011 obj = types.IpAddressAssignment() 9012 9013 # Process the attributes: 9014 obj.href = reader.get_attribute('href') 9015 9016 # Discard the start tag: 9017 empty = reader.empty_element() 9018 reader.read() 9019 if empty: 9020 return obj 9021 9022 # Process the inner elements: 9023 links = [] 9024 while reader.forward(): 9025 tag = reader.node_name() 9026 if tag == 'assignment_method': 9027 obj.assignment_method = Reader.read_enum(types.BootProtocol, reader) 9028 elif tag == 'ip': 9029 obj.ip = IpReader.read_one(reader) 9030 else: 9031 reader.next_element() 9032 for link in links: 9033 IpAddressAssignmentReader._process_link(link, obj) 9034 9035 # Discard the end tag: 9036 reader.read() 9037 9038 return obj 9039 9040 @staticmethod 9041 def read_many(reader): 9042 # Do nothing if there aren't more tags: 9043 objs = List() 9044 if not reader.forward(): 9045 return objs 9046 9047 # Process the attributes: 9048 objs.href = reader.get_attribute('href') 9049 9050 # Discard the start tag: 9051 empty = reader.empty_element() 9052 reader.read() 9053 if empty: 9054 return objs 9055 9056 # Process the inner elements: 9057 while reader.forward(): 9058 objs.append(IpAddressAssignmentReader.read_one(reader)) 9059 9060 # Discard the end tag: 9061 reader.read() 9062 9063 return objs 9064 9065 9066class IscsiBondReader(Reader): 9067 9068 def __init__(self): 9069 super(IscsiBondReader, self).__init__() 9070 9071 @staticmethod 9072 def read_one(reader): 9073 # Do nothing if there aren't more tags: 9074 if not reader.forward(): 9075 return None 9076 9077 # Create the object: 9078 obj = types.IscsiBond() 9079 9080 # Process the attributes: 9081 obj.href = reader.get_attribute('href') 9082 value = reader.get_attribute('id') 9083 if value is not None: 9084 obj.id = value 9085 9086 # Discard the start tag: 9087 empty = reader.empty_element() 9088 reader.read() 9089 if empty: 9090 return obj 9091 9092 # Process the inner elements: 9093 links = [] 9094 while reader.forward(): 9095 tag = reader.node_name() 9096 if tag == 'comment': 9097 obj.comment = Reader.read_string(reader) 9098 elif tag == 'data_center': 9099 obj.data_center = DataCenterReader.read_one(reader) 9100 elif tag == 'description': 9101 obj.description = Reader.read_string(reader) 9102 elif tag == 'name': 9103 obj.name = Reader.read_string(reader) 9104 elif tag == 'networks': 9105 obj.networks = NetworkReader.read_many(reader) 9106 elif tag == 'storage_connections': 9107 obj.storage_connections = StorageConnectionReader.read_many(reader) 9108 elif tag == 'link': 9109 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9110 reader.next_element() 9111 else: 9112 reader.next_element() 9113 for link in links: 9114 IscsiBondReader._process_link(link, obj) 9115 9116 # Discard the end tag: 9117 reader.read() 9118 9119 return obj 9120 9121 @staticmethod 9122 def read_many(reader): 9123 # Do nothing if there aren't more tags: 9124 objs = List() 9125 if not reader.forward(): 9126 return objs 9127 9128 # Process the attributes: 9129 objs.href = reader.get_attribute('href') 9130 9131 # Discard the start tag: 9132 empty = reader.empty_element() 9133 reader.read() 9134 if empty: 9135 return objs 9136 9137 # Process the inner elements: 9138 while reader.forward(): 9139 objs.append(IscsiBondReader.read_one(reader)) 9140 9141 # Discard the end tag: 9142 reader.read() 9143 9144 return objs 9145 9146 @staticmethod 9147 def _process_link(link, obj): 9148 # Process the attributes: 9149 rel = link[0] 9150 href = link[1] 9151 if href and rel: 9152 if rel == "networks": 9153 if obj.networks is not None: 9154 obj.networks.href = href 9155 else: 9156 obj.networks = List(href) 9157 elif rel == "storageconnections": 9158 if obj.storage_connections is not None: 9159 obj.storage_connections.href = href 9160 else: 9161 obj.storage_connections = List(href) 9162 9163 9164class IscsiDetailsReader(Reader): 9165 9166 def __init__(self): 9167 super(IscsiDetailsReader, self).__init__() 9168 9169 @staticmethod 9170 def read_one(reader): 9171 # Do nothing if there aren't more tags: 9172 if not reader.forward(): 9173 return None 9174 9175 # Create the object: 9176 obj = types.IscsiDetails() 9177 9178 # Process the attributes: 9179 obj.href = reader.get_attribute('href') 9180 9181 # Discard the start tag: 9182 empty = reader.empty_element() 9183 reader.read() 9184 if empty: 9185 return obj 9186 9187 # Process the inner elements: 9188 links = [] 9189 while reader.forward(): 9190 tag = reader.node_name() 9191 if tag == 'address': 9192 obj.address = Reader.read_string(reader) 9193 elif tag == 'disk_id': 9194 obj.disk_id = Reader.read_string(reader) 9195 elif tag == 'initiator': 9196 obj.initiator = Reader.read_string(reader) 9197 elif tag == 'lun_mapping': 9198 obj.lun_mapping = Reader.read_integer(reader) 9199 elif tag == 'password': 9200 obj.password = Reader.read_string(reader) 9201 elif tag == 'paths': 9202 obj.paths = Reader.read_integer(reader) 9203 elif tag == 'port': 9204 obj.port = Reader.read_integer(reader) 9205 elif tag == 'portal': 9206 obj.portal = Reader.read_string(reader) 9207 elif tag == 'product_id': 9208 obj.product_id = Reader.read_string(reader) 9209 elif tag == 'serial': 9210 obj.serial = Reader.read_string(reader) 9211 elif tag == 'size': 9212 obj.size = Reader.read_integer(reader) 9213 elif tag == 'status': 9214 obj.status = Reader.read_string(reader) 9215 elif tag == 'storage_domain_id': 9216 obj.storage_domain_id = Reader.read_string(reader) 9217 elif tag == 'target': 9218 obj.target = Reader.read_string(reader) 9219 elif tag == 'username': 9220 obj.username = Reader.read_string(reader) 9221 elif tag == 'vendor_id': 9222 obj.vendor_id = Reader.read_string(reader) 9223 elif tag == 'volume_group_id': 9224 obj.volume_group_id = Reader.read_string(reader) 9225 else: 9226 reader.next_element() 9227 for link in links: 9228 IscsiDetailsReader._process_link(link, obj) 9229 9230 # Discard the end tag: 9231 reader.read() 9232 9233 return obj 9234 9235 @staticmethod 9236 def read_many(reader): 9237 # Do nothing if there aren't more tags: 9238 objs = List() 9239 if not reader.forward(): 9240 return objs 9241 9242 # Process the attributes: 9243 objs.href = reader.get_attribute('href') 9244 9245 # Discard the start tag: 9246 empty = reader.empty_element() 9247 reader.read() 9248 if empty: 9249 return objs 9250 9251 # Process the inner elements: 9252 while reader.forward(): 9253 objs.append(IscsiDetailsReader.read_one(reader)) 9254 9255 # Discard the end tag: 9256 reader.read() 9257 9258 return objs 9259 9260 9261class JobReader(Reader): 9262 9263 def __init__(self): 9264 super(JobReader, self).__init__() 9265 9266 @staticmethod 9267 def read_one(reader): 9268 # Do nothing if there aren't more tags: 9269 if not reader.forward(): 9270 return None 9271 9272 # Create the object: 9273 obj = types.Job() 9274 9275 # Process the attributes: 9276 obj.href = reader.get_attribute('href') 9277 value = reader.get_attribute('id') 9278 if value is not None: 9279 obj.id = value 9280 9281 # Discard the start tag: 9282 empty = reader.empty_element() 9283 reader.read() 9284 if empty: 9285 return obj 9286 9287 # Process the inner elements: 9288 links = [] 9289 while reader.forward(): 9290 tag = reader.node_name() 9291 if tag == 'auto_cleared': 9292 obj.auto_cleared = Reader.read_boolean(reader) 9293 elif tag == 'comment': 9294 obj.comment = Reader.read_string(reader) 9295 elif tag == 'description': 9296 obj.description = Reader.read_string(reader) 9297 elif tag == 'end_time': 9298 obj.end_time = Reader.read_date(reader) 9299 elif tag == 'external': 9300 obj.external = Reader.read_boolean(reader) 9301 elif tag == 'last_updated': 9302 obj.last_updated = Reader.read_date(reader) 9303 elif tag == 'name': 9304 obj.name = Reader.read_string(reader) 9305 elif tag == 'owner': 9306 obj.owner = UserReader.read_one(reader) 9307 elif tag == 'start_time': 9308 obj.start_time = Reader.read_date(reader) 9309 elif tag == 'status': 9310 obj.status = Reader.read_enum(types.JobStatus, reader) 9311 elif tag == 'steps': 9312 obj.steps = StepReader.read_many(reader) 9313 elif tag == 'link': 9314 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9315 reader.next_element() 9316 else: 9317 reader.next_element() 9318 for link in links: 9319 JobReader._process_link(link, obj) 9320 9321 # Discard the end tag: 9322 reader.read() 9323 9324 return obj 9325 9326 @staticmethod 9327 def read_many(reader): 9328 # Do nothing if there aren't more tags: 9329 objs = List() 9330 if not reader.forward(): 9331 return objs 9332 9333 # Process the attributes: 9334 objs.href = reader.get_attribute('href') 9335 9336 # Discard the start tag: 9337 empty = reader.empty_element() 9338 reader.read() 9339 if empty: 9340 return objs 9341 9342 # Process the inner elements: 9343 while reader.forward(): 9344 objs.append(JobReader.read_one(reader)) 9345 9346 # Discard the end tag: 9347 reader.read() 9348 9349 return objs 9350 9351 @staticmethod 9352 def _process_link(link, obj): 9353 # Process the attributes: 9354 rel = link[0] 9355 href = link[1] 9356 if href and rel: 9357 if rel == "steps": 9358 if obj.steps is not None: 9359 obj.steps.href = href 9360 else: 9361 obj.steps = List(href) 9362 9363 9364class KatelloErratumReader(Reader): 9365 9366 def __init__(self): 9367 super(KatelloErratumReader, self).__init__() 9368 9369 @staticmethod 9370 def read_one(reader): 9371 # Do nothing if there aren't more tags: 9372 if not reader.forward(): 9373 return None 9374 9375 # Create the object: 9376 obj = types.KatelloErratum() 9377 9378 # Process the attributes: 9379 obj.href = reader.get_attribute('href') 9380 value = reader.get_attribute('id') 9381 if value is not None: 9382 obj.id = value 9383 9384 # Discard the start tag: 9385 empty = reader.empty_element() 9386 reader.read() 9387 if empty: 9388 return obj 9389 9390 # Process the inner elements: 9391 links = [] 9392 while reader.forward(): 9393 tag = reader.node_name() 9394 if tag == 'comment': 9395 obj.comment = Reader.read_string(reader) 9396 elif tag == 'description': 9397 obj.description = Reader.read_string(reader) 9398 elif tag == 'host': 9399 obj.host = HostReader.read_one(reader) 9400 elif tag == 'issued': 9401 obj.issued = Reader.read_date(reader) 9402 elif tag == 'name': 9403 obj.name = Reader.read_string(reader) 9404 elif tag == 'packages': 9405 obj.packages = PackageReader.read_many(reader) 9406 elif tag == 'severity': 9407 obj.severity = Reader.read_string(reader) 9408 elif tag == 'solution': 9409 obj.solution = Reader.read_string(reader) 9410 elif tag == 'summary': 9411 obj.summary = Reader.read_string(reader) 9412 elif tag == 'title': 9413 obj.title = Reader.read_string(reader) 9414 elif tag == 'type': 9415 obj.type = Reader.read_string(reader) 9416 elif tag == 'vm': 9417 obj.vm = VmReader.read_one(reader) 9418 else: 9419 reader.next_element() 9420 for link in links: 9421 KatelloErratumReader._process_link(link, obj) 9422 9423 # Discard the end tag: 9424 reader.read() 9425 9426 return obj 9427 9428 @staticmethod 9429 def read_many(reader): 9430 # Do nothing if there aren't more tags: 9431 objs = List() 9432 if not reader.forward(): 9433 return objs 9434 9435 # Process the attributes: 9436 objs.href = reader.get_attribute('href') 9437 9438 # Discard the start tag: 9439 empty = reader.empty_element() 9440 reader.read() 9441 if empty: 9442 return objs 9443 9444 # Process the inner elements: 9445 while reader.forward(): 9446 objs.append(KatelloErratumReader.read_one(reader)) 9447 9448 # Discard the end tag: 9449 reader.read() 9450 9451 return objs 9452 9453 9454class KernelReader(Reader): 9455 9456 def __init__(self): 9457 super(KernelReader, self).__init__() 9458 9459 @staticmethod 9460 def read_one(reader): 9461 # Do nothing if there aren't more tags: 9462 if not reader.forward(): 9463 return None 9464 9465 # Create the object: 9466 obj = types.Kernel() 9467 9468 # Process the attributes: 9469 obj.href = reader.get_attribute('href') 9470 9471 # Discard the start tag: 9472 empty = reader.empty_element() 9473 reader.read() 9474 if empty: 9475 return obj 9476 9477 # Process the inner elements: 9478 links = [] 9479 while reader.forward(): 9480 tag = reader.node_name() 9481 if tag == 'version': 9482 obj.version = VersionReader.read_one(reader) 9483 else: 9484 reader.next_element() 9485 for link in links: 9486 KernelReader._process_link(link, obj) 9487 9488 # Discard the end tag: 9489 reader.read() 9490 9491 return obj 9492 9493 @staticmethod 9494 def read_many(reader): 9495 # Do nothing if there aren't more tags: 9496 objs = List() 9497 if not reader.forward(): 9498 return objs 9499 9500 # Process the attributes: 9501 objs.href = reader.get_attribute('href') 9502 9503 # Discard the start tag: 9504 empty = reader.empty_element() 9505 reader.read() 9506 if empty: 9507 return objs 9508 9509 # Process the inner elements: 9510 while reader.forward(): 9511 objs.append(KernelReader.read_one(reader)) 9512 9513 # Discard the end tag: 9514 reader.read() 9515 9516 return objs 9517 9518 9519class KsmReader(Reader): 9520 9521 def __init__(self): 9522 super(KsmReader, self).__init__() 9523 9524 @staticmethod 9525 def read_one(reader): 9526 # Do nothing if there aren't more tags: 9527 if not reader.forward(): 9528 return None 9529 9530 # Create the object: 9531 obj = types.Ksm() 9532 9533 # Process the attributes: 9534 obj.href = reader.get_attribute('href') 9535 9536 # Discard the start tag: 9537 empty = reader.empty_element() 9538 reader.read() 9539 if empty: 9540 return obj 9541 9542 # Process the inner elements: 9543 links = [] 9544 while reader.forward(): 9545 tag = reader.node_name() 9546 if tag == 'enabled': 9547 obj.enabled = Reader.read_boolean(reader) 9548 elif tag == 'merge_across_nodes': 9549 obj.merge_across_nodes = Reader.read_boolean(reader) 9550 else: 9551 reader.next_element() 9552 for link in links: 9553 KsmReader._process_link(link, obj) 9554 9555 # Discard the end tag: 9556 reader.read() 9557 9558 return obj 9559 9560 @staticmethod 9561 def read_many(reader): 9562 # Do nothing if there aren't more tags: 9563 objs = List() 9564 if not reader.forward(): 9565 return objs 9566 9567 # Process the attributes: 9568 objs.href = reader.get_attribute('href') 9569 9570 # Discard the start tag: 9571 empty = reader.empty_element() 9572 reader.read() 9573 if empty: 9574 return objs 9575 9576 # Process the inner elements: 9577 while reader.forward(): 9578 objs.append(KsmReader.read_one(reader)) 9579 9580 # Discard the end tag: 9581 reader.read() 9582 9583 return objs 9584 9585 9586class LinkLayerDiscoveryProtocolElementReader(Reader): 9587 9588 def __init__(self): 9589 super(LinkLayerDiscoveryProtocolElementReader, self).__init__() 9590 9591 @staticmethod 9592 def read_one(reader): 9593 # Do nothing if there aren't more tags: 9594 if not reader.forward(): 9595 return None 9596 9597 # Create the object: 9598 obj = types.LinkLayerDiscoveryProtocolElement() 9599 9600 # Process the attributes: 9601 obj.href = reader.get_attribute('href') 9602 value = reader.get_attribute('id') 9603 if value is not None: 9604 obj.id = value 9605 9606 # Discard the start tag: 9607 empty = reader.empty_element() 9608 reader.read() 9609 if empty: 9610 return obj 9611 9612 # Process the inner elements: 9613 links = [] 9614 while reader.forward(): 9615 tag = reader.node_name() 9616 if tag == 'comment': 9617 obj.comment = Reader.read_string(reader) 9618 elif tag == 'description': 9619 obj.description = Reader.read_string(reader) 9620 elif tag == 'name': 9621 obj.name = Reader.read_string(reader) 9622 elif tag == 'oui': 9623 obj.oui = Reader.read_integer(reader) 9624 elif tag == 'properties': 9625 obj.properties = PropertyReader.read_many(reader) 9626 elif tag == 'subtype': 9627 obj.subtype = Reader.read_integer(reader) 9628 elif tag == 'type': 9629 obj.type = Reader.read_integer(reader) 9630 else: 9631 reader.next_element() 9632 for link in links: 9633 LinkLayerDiscoveryProtocolElementReader._process_link(link, obj) 9634 9635 # Discard the end tag: 9636 reader.read() 9637 9638 return obj 9639 9640 @staticmethod 9641 def read_many(reader): 9642 # Do nothing if there aren't more tags: 9643 objs = List() 9644 if not reader.forward(): 9645 return objs 9646 9647 # Process the attributes: 9648 objs.href = reader.get_attribute('href') 9649 9650 # Discard the start tag: 9651 empty = reader.empty_element() 9652 reader.read() 9653 if empty: 9654 return objs 9655 9656 # Process the inner elements: 9657 while reader.forward(): 9658 objs.append(LinkLayerDiscoveryProtocolElementReader.read_one(reader)) 9659 9660 # Discard the end tag: 9661 reader.read() 9662 9663 return objs 9664 9665 9666class LogicalUnitReader(Reader): 9667 9668 def __init__(self): 9669 super(LogicalUnitReader, self).__init__() 9670 9671 @staticmethod 9672 def read_one(reader): 9673 # Do nothing if there aren't more tags: 9674 if not reader.forward(): 9675 return None 9676 9677 # Create the object: 9678 obj = types.LogicalUnit() 9679 9680 # Process the attributes: 9681 obj.href = reader.get_attribute('href') 9682 value = reader.get_attribute('id') 9683 if value is not None: 9684 obj.id = value 9685 9686 # Discard the start tag: 9687 empty = reader.empty_element() 9688 reader.read() 9689 if empty: 9690 return obj 9691 9692 # Process the inner elements: 9693 links = [] 9694 while reader.forward(): 9695 tag = reader.node_name() 9696 if tag == 'address': 9697 obj.address = Reader.read_string(reader) 9698 elif tag == 'discard_max_size': 9699 obj.discard_max_size = Reader.read_integer(reader) 9700 elif tag == 'discard_zeroes_data': 9701 obj.discard_zeroes_data = Reader.read_boolean(reader) 9702 elif tag == 'disk_id': 9703 obj.disk_id = Reader.read_string(reader) 9704 elif tag == 'lun_mapping': 9705 obj.lun_mapping = Reader.read_integer(reader) 9706 elif tag == 'password': 9707 obj.password = Reader.read_string(reader) 9708 elif tag == 'paths': 9709 obj.paths = Reader.read_integer(reader) 9710 elif tag == 'port': 9711 obj.port = Reader.read_integer(reader) 9712 elif tag == 'portal': 9713 obj.portal = Reader.read_string(reader) 9714 elif tag == 'product_id': 9715 obj.product_id = Reader.read_string(reader) 9716 elif tag == 'serial': 9717 obj.serial = Reader.read_string(reader) 9718 elif tag == 'size': 9719 obj.size = Reader.read_integer(reader) 9720 elif tag == 'status': 9721 obj.status = Reader.read_enum(types.LunStatus, reader) 9722 elif tag == 'storage_domain_id': 9723 obj.storage_domain_id = Reader.read_string(reader) 9724 elif tag == 'target': 9725 obj.target = Reader.read_string(reader) 9726 elif tag == 'username': 9727 obj.username = Reader.read_string(reader) 9728 elif tag == 'vendor_id': 9729 obj.vendor_id = Reader.read_string(reader) 9730 elif tag == 'volume_group_id': 9731 obj.volume_group_id = Reader.read_string(reader) 9732 else: 9733 reader.next_element() 9734 for link in links: 9735 LogicalUnitReader._process_link(link, obj) 9736 9737 # Discard the end tag: 9738 reader.read() 9739 9740 return obj 9741 9742 @staticmethod 9743 def read_many(reader): 9744 # Do nothing if there aren't more tags: 9745 objs = List() 9746 if not reader.forward(): 9747 return objs 9748 9749 # Process the attributes: 9750 objs.href = reader.get_attribute('href') 9751 9752 # Discard the start tag: 9753 empty = reader.empty_element() 9754 reader.read() 9755 if empty: 9756 return objs 9757 9758 # Process the inner elements: 9759 while reader.forward(): 9760 objs.append(LogicalUnitReader.read_one(reader)) 9761 9762 # Discard the end tag: 9763 reader.read() 9764 9765 return objs 9766 9767 9768class MDevTypeReader(Reader): 9769 9770 def __init__(self): 9771 super(MDevTypeReader, self).__init__() 9772 9773 @staticmethod 9774 def read_one(reader): 9775 # Do nothing if there aren't more tags: 9776 if not reader.forward(): 9777 return None 9778 9779 # Create the object: 9780 obj = types.MDevType() 9781 9782 # Process the attributes: 9783 obj.href = reader.get_attribute('href') 9784 9785 # Discard the start tag: 9786 empty = reader.empty_element() 9787 reader.read() 9788 if empty: 9789 return obj 9790 9791 # Process the inner elements: 9792 links = [] 9793 while reader.forward(): 9794 tag = reader.node_name() 9795 if tag == 'available_instances': 9796 obj.available_instances = Reader.read_integer(reader) 9797 elif tag == 'description': 9798 obj.description = Reader.read_string(reader) 9799 elif tag == 'human_readable_name': 9800 obj.human_readable_name = Reader.read_string(reader) 9801 elif tag == 'name': 9802 obj.name = Reader.read_string(reader) 9803 else: 9804 reader.next_element() 9805 for link in links: 9806 MDevTypeReader._process_link(link, obj) 9807 9808 # Discard the end tag: 9809 reader.read() 9810 9811 return obj 9812 9813 @staticmethod 9814 def read_many(reader): 9815 # Do nothing if there aren't more tags: 9816 objs = List() 9817 if not reader.forward(): 9818 return objs 9819 9820 # Process the attributes: 9821 objs.href = reader.get_attribute('href') 9822 9823 # Discard the start tag: 9824 empty = reader.empty_element() 9825 reader.read() 9826 if empty: 9827 return objs 9828 9829 # Process the inner elements: 9830 while reader.forward(): 9831 objs.append(MDevTypeReader.read_one(reader)) 9832 9833 # Discard the end tag: 9834 reader.read() 9835 9836 return objs 9837 9838 9839class MacReader(Reader): 9840 9841 def __init__(self): 9842 super(MacReader, self).__init__() 9843 9844 @staticmethod 9845 def read_one(reader): 9846 # Do nothing if there aren't more tags: 9847 if not reader.forward(): 9848 return None 9849 9850 # Create the object: 9851 obj = types.Mac() 9852 9853 # Process the attributes: 9854 obj.href = reader.get_attribute('href') 9855 9856 # Discard the start tag: 9857 empty = reader.empty_element() 9858 reader.read() 9859 if empty: 9860 return obj 9861 9862 # Process the inner elements: 9863 links = [] 9864 while reader.forward(): 9865 tag = reader.node_name() 9866 if tag == 'address': 9867 obj.address = Reader.read_string(reader) 9868 else: 9869 reader.next_element() 9870 for link in links: 9871 MacReader._process_link(link, obj) 9872 9873 # Discard the end tag: 9874 reader.read() 9875 9876 return obj 9877 9878 @staticmethod 9879 def read_many(reader): 9880 # Do nothing if there aren't more tags: 9881 objs = List() 9882 if not reader.forward(): 9883 return objs 9884 9885 # Process the attributes: 9886 objs.href = reader.get_attribute('href') 9887 9888 # Discard the start tag: 9889 empty = reader.empty_element() 9890 reader.read() 9891 if empty: 9892 return objs 9893 9894 # Process the inner elements: 9895 while reader.forward(): 9896 objs.append(MacReader.read_one(reader)) 9897 9898 # Discard the end tag: 9899 reader.read() 9900 9901 return objs 9902 9903 9904class MacPoolReader(Reader): 9905 9906 def __init__(self): 9907 super(MacPoolReader, self).__init__() 9908 9909 @staticmethod 9910 def read_one(reader): 9911 # Do nothing if there aren't more tags: 9912 if not reader.forward(): 9913 return None 9914 9915 # Create the object: 9916 obj = types.MacPool() 9917 9918 # Process the attributes: 9919 obj.href = reader.get_attribute('href') 9920 value = reader.get_attribute('id') 9921 if value is not None: 9922 obj.id = value 9923 9924 # Discard the start tag: 9925 empty = reader.empty_element() 9926 reader.read() 9927 if empty: 9928 return obj 9929 9930 # Process the inner elements: 9931 links = [] 9932 while reader.forward(): 9933 tag = reader.node_name() 9934 if tag == 'allow_duplicates': 9935 obj.allow_duplicates = Reader.read_boolean(reader) 9936 elif tag == 'comment': 9937 obj.comment = Reader.read_string(reader) 9938 elif tag == 'default_pool': 9939 obj.default_pool = Reader.read_boolean(reader) 9940 elif tag == 'description': 9941 obj.description = Reader.read_string(reader) 9942 elif tag == 'name': 9943 obj.name = Reader.read_string(reader) 9944 elif tag == 'permissions': 9945 obj.permissions = PermissionReader.read_many(reader) 9946 elif tag == 'ranges': 9947 obj.ranges = RangeReader.read_many(reader) 9948 elif tag == 'link': 9949 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9950 reader.next_element() 9951 else: 9952 reader.next_element() 9953 for link in links: 9954 MacPoolReader._process_link(link, obj) 9955 9956 # Discard the end tag: 9957 reader.read() 9958 9959 return obj 9960 9961 @staticmethod 9962 def read_many(reader): 9963 # Do nothing if there aren't more tags: 9964 objs = List() 9965 if not reader.forward(): 9966 return objs 9967 9968 # Process the attributes: 9969 objs.href = reader.get_attribute('href') 9970 9971 # Discard the start tag: 9972 empty = reader.empty_element() 9973 reader.read() 9974 if empty: 9975 return objs 9976 9977 # Process the inner elements: 9978 while reader.forward(): 9979 objs.append(MacPoolReader.read_one(reader)) 9980 9981 # Discard the end tag: 9982 reader.read() 9983 9984 return objs 9985 9986 @staticmethod 9987 def _process_link(link, obj): 9988 # Process the attributes: 9989 rel = link[0] 9990 href = link[1] 9991 if href and rel: 9992 if rel == "permissions": 9993 if obj.permissions is not None: 9994 obj.permissions.href = href 9995 else: 9996 obj.permissions = List(href) 9997 9998 9999class MemoryOverCommitReader(Reader): 10000 10001 def __init__(self): 10002 super(MemoryOverCommitReader, self).__init__() 10003 10004 @staticmethod 10005 def read_one(reader): 10006 # Do nothing if there aren't more tags: 10007 if not reader.forward(): 10008 return None 10009 10010 # Create the object: 10011 obj = types.MemoryOverCommit() 10012 10013 # Process the attributes: 10014 obj.href = reader.get_attribute('href') 10015 10016 # Discard the start tag: 10017 empty = reader.empty_element() 10018 reader.read() 10019 if empty: 10020 return obj 10021 10022 # Process the inner elements: 10023 links = [] 10024 while reader.forward(): 10025 tag = reader.node_name() 10026 if tag == 'percent': 10027 obj.percent = Reader.read_integer(reader) 10028 else: 10029 reader.next_element() 10030 for link in links: 10031 MemoryOverCommitReader._process_link(link, obj) 10032 10033 # Discard the end tag: 10034 reader.read() 10035 10036 return obj 10037 10038 @staticmethod 10039 def read_many(reader): 10040 # Do nothing if there aren't more tags: 10041 objs = List() 10042 if not reader.forward(): 10043 return objs 10044 10045 # Process the attributes: 10046 objs.href = reader.get_attribute('href') 10047 10048 # Discard the start tag: 10049 empty = reader.empty_element() 10050 reader.read() 10051 if empty: 10052 return objs 10053 10054 # Process the inner elements: 10055 while reader.forward(): 10056 objs.append(MemoryOverCommitReader.read_one(reader)) 10057 10058 # Discard the end tag: 10059 reader.read() 10060 10061 return objs 10062 10063 10064class MemoryPolicyReader(Reader): 10065 10066 def __init__(self): 10067 super(MemoryPolicyReader, self).__init__() 10068 10069 @staticmethod 10070 def read_one(reader): 10071 # Do nothing if there aren't more tags: 10072 if not reader.forward(): 10073 return None 10074 10075 # Create the object: 10076 obj = types.MemoryPolicy() 10077 10078 # Process the attributes: 10079 obj.href = reader.get_attribute('href') 10080 10081 # Discard the start tag: 10082 empty = reader.empty_element() 10083 reader.read() 10084 if empty: 10085 return obj 10086 10087 # Process the inner elements: 10088 links = [] 10089 while reader.forward(): 10090 tag = reader.node_name() 10091 if tag == 'ballooning': 10092 obj.ballooning = Reader.read_boolean(reader) 10093 elif tag == 'guaranteed': 10094 obj.guaranteed = Reader.read_integer(reader) 10095 elif tag == 'max': 10096 obj.max = Reader.read_integer(reader) 10097 elif tag == 'over_commit': 10098 obj.over_commit = MemoryOverCommitReader.read_one(reader) 10099 elif tag == 'transparent_hugepages': 10100 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 10101 else: 10102 reader.next_element() 10103 for link in links: 10104 MemoryPolicyReader._process_link(link, obj) 10105 10106 # Discard the end tag: 10107 reader.read() 10108 10109 return obj 10110 10111 @staticmethod 10112 def read_many(reader): 10113 # Do nothing if there aren't more tags: 10114 objs = List() 10115 if not reader.forward(): 10116 return objs 10117 10118 # Process the attributes: 10119 objs.href = reader.get_attribute('href') 10120 10121 # Discard the start tag: 10122 empty = reader.empty_element() 10123 reader.read() 10124 if empty: 10125 return objs 10126 10127 # Process the inner elements: 10128 while reader.forward(): 10129 objs.append(MemoryPolicyReader.read_one(reader)) 10130 10131 # Discard the end tag: 10132 reader.read() 10133 10134 return objs 10135 10136 10137class MethodReader(Reader): 10138 10139 def __init__(self): 10140 super(MethodReader, self).__init__() 10141 10142 @staticmethod 10143 def read_one(reader): 10144 # Do nothing if there aren't more tags: 10145 if not reader.forward(): 10146 return None 10147 10148 # Create the object: 10149 obj = types.Method() 10150 10151 # Process the attributes: 10152 obj.href = reader.get_attribute('href') 10153 value = reader.get_attribute('id') 10154 if value is not None: 10155 obj.id = types.SsoMethod(value.lower()) 10156 10157 # Discard the start tag: 10158 empty = reader.empty_element() 10159 reader.read() 10160 if empty: 10161 return obj 10162 10163 # Process the inner elements: 10164 reader.next_element() 10165 10166 # Discard the end tag: 10167 reader.read() 10168 10169 return obj 10170 10171 @staticmethod 10172 def read_many(reader): 10173 # Do nothing if there aren't more tags: 10174 objs = List() 10175 if not reader.forward(): 10176 return objs 10177 10178 # Process the attributes: 10179 objs.href = reader.get_attribute('href') 10180 10181 # Discard the start tag: 10182 empty = reader.empty_element() 10183 reader.read() 10184 if empty: 10185 return objs 10186 10187 # Process the inner elements: 10188 while reader.forward(): 10189 objs.append(MethodReader.read_one(reader)) 10190 10191 # Discard the end tag: 10192 reader.read() 10193 10194 return objs 10195 10196 10197class MigrationBandwidthReader(Reader): 10198 10199 def __init__(self): 10200 super(MigrationBandwidthReader, self).__init__() 10201 10202 @staticmethod 10203 def read_one(reader): 10204 # Do nothing if there aren't more tags: 10205 if not reader.forward(): 10206 return None 10207 10208 # Create the object: 10209 obj = types.MigrationBandwidth() 10210 10211 # Process the attributes: 10212 obj.href = reader.get_attribute('href') 10213 10214 # Discard the start tag: 10215 empty = reader.empty_element() 10216 reader.read() 10217 if empty: 10218 return obj 10219 10220 # Process the inner elements: 10221 links = [] 10222 while reader.forward(): 10223 tag = reader.node_name() 10224 if tag == 'assignment_method': 10225 obj.assignment_method = Reader.read_enum(types.MigrationBandwidthAssignmentMethod, reader) 10226 elif tag == 'custom_value': 10227 obj.custom_value = Reader.read_integer(reader) 10228 else: 10229 reader.next_element() 10230 for link in links: 10231 MigrationBandwidthReader._process_link(link, obj) 10232 10233 # Discard the end tag: 10234 reader.read() 10235 10236 return obj 10237 10238 @staticmethod 10239 def read_many(reader): 10240 # Do nothing if there aren't more tags: 10241 objs = List() 10242 if not reader.forward(): 10243 return objs 10244 10245 # Process the attributes: 10246 objs.href = reader.get_attribute('href') 10247 10248 # Discard the start tag: 10249 empty = reader.empty_element() 10250 reader.read() 10251 if empty: 10252 return objs 10253 10254 # Process the inner elements: 10255 while reader.forward(): 10256 objs.append(MigrationBandwidthReader.read_one(reader)) 10257 10258 # Discard the end tag: 10259 reader.read() 10260 10261 return objs 10262 10263 10264class MigrationOptionsReader(Reader): 10265 10266 def __init__(self): 10267 super(MigrationOptionsReader, self).__init__() 10268 10269 @staticmethod 10270 def read_one(reader): 10271 # Do nothing if there aren't more tags: 10272 if not reader.forward(): 10273 return None 10274 10275 # Create the object: 10276 obj = types.MigrationOptions() 10277 10278 # Process the attributes: 10279 obj.href = reader.get_attribute('href') 10280 10281 # Discard the start tag: 10282 empty = reader.empty_element() 10283 reader.read() 10284 if empty: 10285 return obj 10286 10287 # Process the inner elements: 10288 links = [] 10289 while reader.forward(): 10290 tag = reader.node_name() 10291 if tag == 'auto_converge': 10292 obj.auto_converge = Reader.read_enum(types.InheritableBoolean, reader) 10293 elif tag == 'bandwidth': 10294 obj.bandwidth = MigrationBandwidthReader.read_one(reader) 10295 elif tag == 'compressed': 10296 obj.compressed = Reader.read_enum(types.InheritableBoolean, reader) 10297 elif tag == 'encrypted': 10298 obj.encrypted = Reader.read_enum(types.InheritableBoolean, reader) 10299 elif tag == 'policy': 10300 obj.policy = MigrationPolicyReader.read_one(reader) 10301 else: 10302 reader.next_element() 10303 for link in links: 10304 MigrationOptionsReader._process_link(link, obj) 10305 10306 # Discard the end tag: 10307 reader.read() 10308 10309 return obj 10310 10311 @staticmethod 10312 def read_many(reader): 10313 # Do nothing if there aren't more tags: 10314 objs = List() 10315 if not reader.forward(): 10316 return objs 10317 10318 # Process the attributes: 10319 objs.href = reader.get_attribute('href') 10320 10321 # Discard the start tag: 10322 empty = reader.empty_element() 10323 reader.read() 10324 if empty: 10325 return objs 10326 10327 # Process the inner elements: 10328 while reader.forward(): 10329 objs.append(MigrationOptionsReader.read_one(reader)) 10330 10331 # Discard the end tag: 10332 reader.read() 10333 10334 return objs 10335 10336 10337class MigrationPolicyReader(Reader): 10338 10339 def __init__(self): 10340 super(MigrationPolicyReader, self).__init__() 10341 10342 @staticmethod 10343 def read_one(reader): 10344 # Do nothing if there aren't more tags: 10345 if not reader.forward(): 10346 return None 10347 10348 # Create the object: 10349 obj = types.MigrationPolicy() 10350 10351 # Process the attributes: 10352 obj.href = reader.get_attribute('href') 10353 value = reader.get_attribute('id') 10354 if value is not None: 10355 obj.id = value 10356 10357 # Discard the start tag: 10358 empty = reader.empty_element() 10359 reader.read() 10360 if empty: 10361 return obj 10362 10363 # Process the inner elements: 10364 links = [] 10365 while reader.forward(): 10366 tag = reader.node_name() 10367 if tag == 'comment': 10368 obj.comment = Reader.read_string(reader) 10369 elif tag == 'description': 10370 obj.description = Reader.read_string(reader) 10371 elif tag == 'name': 10372 obj.name = Reader.read_string(reader) 10373 else: 10374 reader.next_element() 10375 for link in links: 10376 MigrationPolicyReader._process_link(link, obj) 10377 10378 # Discard the end tag: 10379 reader.read() 10380 10381 return obj 10382 10383 @staticmethod 10384 def read_many(reader): 10385 # Do nothing if there aren't more tags: 10386 objs = List() 10387 if not reader.forward(): 10388 return objs 10389 10390 # Process the attributes: 10391 objs.href = reader.get_attribute('href') 10392 10393 # Discard the start tag: 10394 empty = reader.empty_element() 10395 reader.read() 10396 if empty: 10397 return objs 10398 10399 # Process the inner elements: 10400 while reader.forward(): 10401 objs.append(MigrationPolicyReader.read_one(reader)) 10402 10403 # Discard the end tag: 10404 reader.read() 10405 10406 return objs 10407 10408 10409class NetworkReader(Reader): 10410 10411 def __init__(self): 10412 super(NetworkReader, self).__init__() 10413 10414 @staticmethod 10415 def read_one(reader): 10416 # Do nothing if there aren't more tags: 10417 if not reader.forward(): 10418 return None 10419 10420 # Create the object: 10421 obj = types.Network() 10422 10423 # Process the attributes: 10424 obj.href = reader.get_attribute('href') 10425 value = reader.get_attribute('id') 10426 if value is not None: 10427 obj.id = value 10428 10429 # Discard the start tag: 10430 empty = reader.empty_element() 10431 reader.read() 10432 if empty: 10433 return obj 10434 10435 # Process the inner elements: 10436 links = [] 10437 while reader.forward(): 10438 tag = reader.node_name() 10439 if tag == 'cluster': 10440 obj.cluster = ClusterReader.read_one(reader) 10441 elif tag == 'comment': 10442 obj.comment = Reader.read_string(reader) 10443 elif tag == 'data_center': 10444 obj.data_center = DataCenterReader.read_one(reader) 10445 elif tag == 'description': 10446 obj.description = Reader.read_string(reader) 10447 elif tag == 'display': 10448 obj.display = Reader.read_boolean(reader) 10449 elif tag == 'dns_resolver_configuration': 10450 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10451 elif tag == 'external_provider': 10452 obj.external_provider = OpenStackNetworkProviderReader.read_one(reader) 10453 elif tag == 'external_provider_physical_network': 10454 obj.external_provider_physical_network = NetworkReader.read_one(reader) 10455 elif tag == 'ip': 10456 obj.ip = IpReader.read_one(reader) 10457 elif tag == 'mtu': 10458 obj.mtu = Reader.read_integer(reader) 10459 elif tag == 'name': 10460 obj.name = Reader.read_string(reader) 10461 elif tag == 'network_labels': 10462 obj.network_labels = NetworkLabelReader.read_many(reader) 10463 elif tag == 'permissions': 10464 obj.permissions = PermissionReader.read_many(reader) 10465 elif tag == 'port_isolation': 10466 obj.port_isolation = Reader.read_boolean(reader) 10467 elif tag == 'profile_required': 10468 obj.profile_required = Reader.read_boolean(reader) 10469 elif tag == 'qos': 10470 obj.qos = QosReader.read_one(reader) 10471 elif tag == 'required': 10472 obj.required = Reader.read_boolean(reader) 10473 elif tag == 'status': 10474 obj.status = Reader.read_enum(types.NetworkStatus, reader) 10475 elif tag == 'stp': 10476 obj.stp = Reader.read_boolean(reader) 10477 elif tag == 'usages': 10478 obj.usages = Reader.read_enums(types.NetworkUsage, reader) 10479 elif tag == 'vdsm_name': 10480 obj.vdsm_name = Reader.read_string(reader) 10481 elif tag == 'vlan': 10482 obj.vlan = VlanReader.read_one(reader) 10483 elif tag == 'vnic_profiles': 10484 obj.vnic_profiles = VnicProfileReader.read_many(reader) 10485 elif tag == 'link': 10486 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 10487 reader.next_element() 10488 else: 10489 reader.next_element() 10490 for link in links: 10491 NetworkReader._process_link(link, obj) 10492 10493 # Discard the end tag: 10494 reader.read() 10495 10496 return obj 10497 10498 @staticmethod 10499 def read_many(reader): 10500 # Do nothing if there aren't more tags: 10501 objs = List() 10502 if not reader.forward(): 10503 return objs 10504 10505 # Process the attributes: 10506 objs.href = reader.get_attribute('href') 10507 10508 # Discard the start tag: 10509 empty = reader.empty_element() 10510 reader.read() 10511 if empty: 10512 return objs 10513 10514 # Process the inner elements: 10515 while reader.forward(): 10516 objs.append(NetworkReader.read_one(reader)) 10517 10518 # Discard the end tag: 10519 reader.read() 10520 10521 return objs 10522 10523 @staticmethod 10524 def _process_link(link, obj): 10525 # Process the attributes: 10526 rel = link[0] 10527 href = link[1] 10528 if href and rel: 10529 if rel == "networklabels": 10530 if obj.network_labels is not None: 10531 obj.network_labels.href = href 10532 else: 10533 obj.network_labels = List(href) 10534 elif rel == "permissions": 10535 if obj.permissions is not None: 10536 obj.permissions.href = href 10537 else: 10538 obj.permissions = List(href) 10539 elif rel == "vnicprofiles": 10540 if obj.vnic_profiles is not None: 10541 obj.vnic_profiles.href = href 10542 else: 10543 obj.vnic_profiles = List(href) 10544 10545 10546class NetworkAttachmentReader(Reader): 10547 10548 def __init__(self): 10549 super(NetworkAttachmentReader, self).__init__() 10550 10551 @staticmethod 10552 def read_one(reader): 10553 # Do nothing if there aren't more tags: 10554 if not reader.forward(): 10555 return None 10556 10557 # Create the object: 10558 obj = types.NetworkAttachment() 10559 10560 # Process the attributes: 10561 obj.href = reader.get_attribute('href') 10562 value = reader.get_attribute('id') 10563 if value is not None: 10564 obj.id = value 10565 10566 # Discard the start tag: 10567 empty = reader.empty_element() 10568 reader.read() 10569 if empty: 10570 return obj 10571 10572 # Process the inner elements: 10573 links = [] 10574 while reader.forward(): 10575 tag = reader.node_name() 10576 if tag == 'comment': 10577 obj.comment = Reader.read_string(reader) 10578 elif tag == 'description': 10579 obj.description = Reader.read_string(reader) 10580 elif tag == 'dns_resolver_configuration': 10581 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10582 elif tag == 'host': 10583 obj.host = HostReader.read_one(reader) 10584 elif tag == 'host_nic': 10585 obj.host_nic = HostNicReader.read_one(reader) 10586 elif tag == 'in_sync': 10587 obj.in_sync = Reader.read_boolean(reader) 10588 elif tag == 'ip_address_assignments': 10589 obj.ip_address_assignments = IpAddressAssignmentReader.read_many(reader) 10590 elif tag == 'name': 10591 obj.name = Reader.read_string(reader) 10592 elif tag == 'network': 10593 obj.network = NetworkReader.read_one(reader) 10594 elif tag == 'properties': 10595 obj.properties = PropertyReader.read_many(reader) 10596 elif tag == 'qos': 10597 obj.qos = QosReader.read_one(reader) 10598 elif tag == 'reported_configurations': 10599 obj.reported_configurations = ReportedConfigurationReader.read_many(reader) 10600 else: 10601 reader.next_element() 10602 for link in links: 10603 NetworkAttachmentReader._process_link(link, obj) 10604 10605 # Discard the end tag: 10606 reader.read() 10607 10608 return obj 10609 10610 @staticmethod 10611 def read_many(reader): 10612 # Do nothing if there aren't more tags: 10613 objs = List() 10614 if not reader.forward(): 10615 return objs 10616 10617 # Process the attributes: 10618 objs.href = reader.get_attribute('href') 10619 10620 # Discard the start tag: 10621 empty = reader.empty_element() 10622 reader.read() 10623 if empty: 10624 return objs 10625 10626 # Process the inner elements: 10627 while reader.forward(): 10628 objs.append(NetworkAttachmentReader.read_one(reader)) 10629 10630 # Discard the end tag: 10631 reader.read() 10632 10633 return objs 10634 10635 10636class NetworkConfigurationReader(Reader): 10637 10638 def __init__(self): 10639 super(NetworkConfigurationReader, self).__init__() 10640 10641 @staticmethod 10642 def read_one(reader): 10643 # Do nothing if there aren't more tags: 10644 if not reader.forward(): 10645 return None 10646 10647 # Create the object: 10648 obj = types.NetworkConfiguration() 10649 10650 # Process the attributes: 10651 obj.href = reader.get_attribute('href') 10652 10653 # Discard the start tag: 10654 empty = reader.empty_element() 10655 reader.read() 10656 if empty: 10657 return obj 10658 10659 # Process the inner elements: 10660 links = [] 10661 while reader.forward(): 10662 tag = reader.node_name() 10663 if tag == 'dns': 10664 obj.dns = DnsReader.read_one(reader) 10665 elif tag == 'nics': 10666 obj.nics = NicReader.read_many(reader) 10667 else: 10668 reader.next_element() 10669 for link in links: 10670 NetworkConfigurationReader._process_link(link, obj) 10671 10672 # Discard the end tag: 10673 reader.read() 10674 10675 return obj 10676 10677 @staticmethod 10678 def read_many(reader): 10679 # Do nothing if there aren't more tags: 10680 objs = List() 10681 if not reader.forward(): 10682 return objs 10683 10684 # Process the attributes: 10685 objs.href = reader.get_attribute('href') 10686 10687 # Discard the start tag: 10688 empty = reader.empty_element() 10689 reader.read() 10690 if empty: 10691 return objs 10692 10693 # Process the inner elements: 10694 while reader.forward(): 10695 objs.append(NetworkConfigurationReader.read_one(reader)) 10696 10697 # Discard the end tag: 10698 reader.read() 10699 10700 return objs 10701 10702 10703class NetworkFilterReader(Reader): 10704 10705 def __init__(self): 10706 super(NetworkFilterReader, self).__init__() 10707 10708 @staticmethod 10709 def read_one(reader): 10710 # Do nothing if there aren't more tags: 10711 if not reader.forward(): 10712 return None 10713 10714 # Create the object: 10715 obj = types.NetworkFilter() 10716 10717 # Process the attributes: 10718 obj.href = reader.get_attribute('href') 10719 value = reader.get_attribute('id') 10720 if value is not None: 10721 obj.id = value 10722 10723 # Discard the start tag: 10724 empty = reader.empty_element() 10725 reader.read() 10726 if empty: 10727 return obj 10728 10729 # Process the inner elements: 10730 links = [] 10731 while reader.forward(): 10732 tag = reader.node_name() 10733 if tag == 'comment': 10734 obj.comment = Reader.read_string(reader) 10735 elif tag == 'description': 10736 obj.description = Reader.read_string(reader) 10737 elif tag == 'name': 10738 obj.name = Reader.read_string(reader) 10739 elif tag == 'version': 10740 obj.version = VersionReader.read_one(reader) 10741 else: 10742 reader.next_element() 10743 for link in links: 10744 NetworkFilterReader._process_link(link, obj) 10745 10746 # Discard the end tag: 10747 reader.read() 10748 10749 return obj 10750 10751 @staticmethod 10752 def read_many(reader): 10753 # Do nothing if there aren't more tags: 10754 objs = List() 10755 if not reader.forward(): 10756 return objs 10757 10758 # Process the attributes: 10759 objs.href = reader.get_attribute('href') 10760 10761 # Discard the start tag: 10762 empty = reader.empty_element() 10763 reader.read() 10764 if empty: 10765 return objs 10766 10767 # Process the inner elements: 10768 while reader.forward(): 10769 objs.append(NetworkFilterReader.read_one(reader)) 10770 10771 # Discard the end tag: 10772 reader.read() 10773 10774 return objs 10775 10776 10777class NetworkFilterParameterReader(Reader): 10778 10779 def __init__(self): 10780 super(NetworkFilterParameterReader, self).__init__() 10781 10782 @staticmethod 10783 def read_one(reader): 10784 # Do nothing if there aren't more tags: 10785 if not reader.forward(): 10786 return None 10787 10788 # Create the object: 10789 obj = types.NetworkFilterParameter() 10790 10791 # Process the attributes: 10792 obj.href = reader.get_attribute('href') 10793 value = reader.get_attribute('id') 10794 if value is not None: 10795 obj.id = value 10796 10797 # Discard the start tag: 10798 empty = reader.empty_element() 10799 reader.read() 10800 if empty: 10801 return obj 10802 10803 # Process the inner elements: 10804 links = [] 10805 while reader.forward(): 10806 tag = reader.node_name() 10807 if tag == 'comment': 10808 obj.comment = Reader.read_string(reader) 10809 elif tag == 'description': 10810 obj.description = Reader.read_string(reader) 10811 elif tag == 'name': 10812 obj.name = Reader.read_string(reader) 10813 elif tag == 'nic': 10814 obj.nic = NicReader.read_one(reader) 10815 elif tag == 'value': 10816 obj.value = Reader.read_string(reader) 10817 else: 10818 reader.next_element() 10819 for link in links: 10820 NetworkFilterParameterReader._process_link(link, obj) 10821 10822 # Discard the end tag: 10823 reader.read() 10824 10825 return obj 10826 10827 @staticmethod 10828 def read_many(reader): 10829 # Do nothing if there aren't more tags: 10830 objs = List() 10831 if not reader.forward(): 10832 return objs 10833 10834 # Process the attributes: 10835 objs.href = reader.get_attribute('href') 10836 10837 # Discard the start tag: 10838 empty = reader.empty_element() 10839 reader.read() 10840 if empty: 10841 return objs 10842 10843 # Process the inner elements: 10844 while reader.forward(): 10845 objs.append(NetworkFilterParameterReader.read_one(reader)) 10846 10847 # Discard the end tag: 10848 reader.read() 10849 10850 return objs 10851 10852 10853class NetworkLabelReader(Reader): 10854 10855 def __init__(self): 10856 super(NetworkLabelReader, self).__init__() 10857 10858 @staticmethod 10859 def read_one(reader): 10860 # Do nothing if there aren't more tags: 10861 if not reader.forward(): 10862 return None 10863 10864 # Create the object: 10865 obj = types.NetworkLabel() 10866 10867 # Process the attributes: 10868 obj.href = reader.get_attribute('href') 10869 value = reader.get_attribute('id') 10870 if value is not None: 10871 obj.id = value 10872 10873 # Discard the start tag: 10874 empty = reader.empty_element() 10875 reader.read() 10876 if empty: 10877 return obj 10878 10879 # Process the inner elements: 10880 links = [] 10881 while reader.forward(): 10882 tag = reader.node_name() 10883 if tag == 'comment': 10884 obj.comment = Reader.read_string(reader) 10885 elif tag == 'description': 10886 obj.description = Reader.read_string(reader) 10887 elif tag == 'host_nic': 10888 obj.host_nic = HostNicReader.read_one(reader) 10889 elif tag == 'name': 10890 obj.name = Reader.read_string(reader) 10891 elif tag == 'network': 10892 obj.network = NetworkReader.read_one(reader) 10893 else: 10894 reader.next_element() 10895 for link in links: 10896 NetworkLabelReader._process_link(link, obj) 10897 10898 # Discard the end tag: 10899 reader.read() 10900 10901 return obj 10902 10903 @staticmethod 10904 def read_many(reader): 10905 # Do nothing if there aren't more tags: 10906 objs = List() 10907 if not reader.forward(): 10908 return objs 10909 10910 # Process the attributes: 10911 objs.href = reader.get_attribute('href') 10912 10913 # Discard the start tag: 10914 empty = reader.empty_element() 10915 reader.read() 10916 if empty: 10917 return objs 10918 10919 # Process the inner elements: 10920 while reader.forward(): 10921 objs.append(NetworkLabelReader.read_one(reader)) 10922 10923 # Discard the end tag: 10924 reader.read() 10925 10926 return objs 10927 10928 10929class NfsProfileDetailReader(Reader): 10930 10931 def __init__(self): 10932 super(NfsProfileDetailReader, self).__init__() 10933 10934 @staticmethod 10935 def read_one(reader): 10936 # Do nothing if there aren't more tags: 10937 if not reader.forward(): 10938 return None 10939 10940 # Create the object: 10941 obj = types.NfsProfileDetail() 10942 10943 # Process the attributes: 10944 obj.href = reader.get_attribute('href') 10945 10946 # Discard the start tag: 10947 empty = reader.empty_element() 10948 reader.read() 10949 if empty: 10950 return obj 10951 10952 # Process the inner elements: 10953 links = [] 10954 while reader.forward(): 10955 tag = reader.node_name() 10956 if tag == 'nfs_server_ip': 10957 obj.nfs_server_ip = Reader.read_string(reader) 10958 elif tag == 'profile_details': 10959 obj.profile_details = ProfileDetailReader.read_many(reader) 10960 else: 10961 reader.next_element() 10962 for link in links: 10963 NfsProfileDetailReader._process_link(link, obj) 10964 10965 # Discard the end tag: 10966 reader.read() 10967 10968 return obj 10969 10970 @staticmethod 10971 def read_many(reader): 10972 # Do nothing if there aren't more tags: 10973 objs = List() 10974 if not reader.forward(): 10975 return objs 10976 10977 # Process the attributes: 10978 objs.href = reader.get_attribute('href') 10979 10980 # Discard the start tag: 10981 empty = reader.empty_element() 10982 reader.read() 10983 if empty: 10984 return objs 10985 10986 # Process the inner elements: 10987 while reader.forward(): 10988 objs.append(NfsProfileDetailReader.read_one(reader)) 10989 10990 # Discard the end tag: 10991 reader.read() 10992 10993 return objs 10994 10995 10996class NicReader(Reader): 10997 10998 def __init__(self): 10999 super(NicReader, self).__init__() 11000 11001 @staticmethod 11002 def read_one(reader): 11003 # Do nothing if there aren't more tags: 11004 if not reader.forward(): 11005 return None 11006 11007 # Create the object: 11008 obj = types.Nic() 11009 11010 # Process the attributes: 11011 obj.href = reader.get_attribute('href') 11012 value = reader.get_attribute('id') 11013 if value is not None: 11014 obj.id = value 11015 11016 # Discard the start tag: 11017 empty = reader.empty_element() 11018 reader.read() 11019 if empty: 11020 return obj 11021 11022 # Process the inner elements: 11023 links = [] 11024 while reader.forward(): 11025 tag = reader.node_name() 11026 if tag == 'boot_protocol': 11027 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11028 elif tag == 'comment': 11029 obj.comment = Reader.read_string(reader) 11030 elif tag == 'description': 11031 obj.description = Reader.read_string(reader) 11032 elif tag == 'instance_type': 11033 obj.instance_type = InstanceTypeReader.read_one(reader) 11034 elif tag == 'interface': 11035 obj.interface = Reader.read_enum(types.NicInterface, reader) 11036 elif tag == 'linked': 11037 obj.linked = Reader.read_boolean(reader) 11038 elif tag == 'mac': 11039 obj.mac = MacReader.read_one(reader) 11040 elif tag == 'name': 11041 obj.name = Reader.read_string(reader) 11042 elif tag == 'network': 11043 obj.network = NetworkReader.read_one(reader) 11044 elif tag == 'network_attachments': 11045 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 11046 elif tag == 'network_filter_parameters': 11047 obj.network_filter_parameters = NetworkFilterParameterReader.read_many(reader) 11048 elif tag == 'network_labels': 11049 obj.network_labels = NetworkLabelReader.read_many(reader) 11050 elif tag == 'on_boot': 11051 obj.on_boot = Reader.read_boolean(reader) 11052 elif tag == 'plugged': 11053 obj.plugged = Reader.read_boolean(reader) 11054 elif tag == 'reported_devices': 11055 obj.reported_devices = ReportedDeviceReader.read_many(reader) 11056 elif tag == 'statistics': 11057 obj.statistics = StatisticReader.read_many(reader) 11058 elif tag == 'synced': 11059 obj.synced = Reader.read_boolean(reader) 11060 elif tag == 'template': 11061 obj.template = TemplateReader.read_one(reader) 11062 elif tag == 'virtual_function_allowed_labels': 11063 obj.virtual_function_allowed_labels = NetworkLabelReader.read_many(reader) 11064 elif tag == 'virtual_function_allowed_networks': 11065 obj.virtual_function_allowed_networks = NetworkReader.read_many(reader) 11066 elif tag == 'vm': 11067 obj.vm = VmReader.read_one(reader) 11068 elif tag == 'vms': 11069 obj.vms = VmReader.read_many(reader) 11070 elif tag == 'vnic_profile': 11071 obj.vnic_profile = VnicProfileReader.read_one(reader) 11072 elif tag == 'link': 11073 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11074 reader.next_element() 11075 else: 11076 reader.next_element() 11077 for link in links: 11078 NicReader._process_link(link, obj) 11079 11080 # Discard the end tag: 11081 reader.read() 11082 11083 return obj 11084 11085 @staticmethod 11086 def read_many(reader): 11087 # Do nothing if there aren't more tags: 11088 objs = List() 11089 if not reader.forward(): 11090 return objs 11091 11092 # Process the attributes: 11093 objs.href = reader.get_attribute('href') 11094 11095 # Discard the start tag: 11096 empty = reader.empty_element() 11097 reader.read() 11098 if empty: 11099 return objs 11100 11101 # Process the inner elements: 11102 while reader.forward(): 11103 objs.append(NicReader.read_one(reader)) 11104 11105 # Discard the end tag: 11106 reader.read() 11107 11108 return objs 11109 11110 @staticmethod 11111 def _process_link(link, obj): 11112 # Process the attributes: 11113 rel = link[0] 11114 href = link[1] 11115 if href and rel: 11116 if rel == "networkattachments": 11117 if obj.network_attachments is not None: 11118 obj.network_attachments.href = href 11119 else: 11120 obj.network_attachments = List(href) 11121 elif rel == "networkfilterparameters": 11122 if obj.network_filter_parameters is not None: 11123 obj.network_filter_parameters.href = href 11124 else: 11125 obj.network_filter_parameters = List(href) 11126 elif rel == "networklabels": 11127 if obj.network_labels is not None: 11128 obj.network_labels.href = href 11129 else: 11130 obj.network_labels = List(href) 11131 elif rel == "reporteddevices": 11132 if obj.reported_devices is not None: 11133 obj.reported_devices.href = href 11134 else: 11135 obj.reported_devices = List(href) 11136 elif rel == "statistics": 11137 if obj.statistics is not None: 11138 obj.statistics.href = href 11139 else: 11140 obj.statistics = List(href) 11141 elif rel == "virtualfunctionallowedlabels": 11142 if obj.virtual_function_allowed_labels is not None: 11143 obj.virtual_function_allowed_labels.href = href 11144 else: 11145 obj.virtual_function_allowed_labels = List(href) 11146 elif rel == "virtualfunctionallowednetworks": 11147 if obj.virtual_function_allowed_networks is not None: 11148 obj.virtual_function_allowed_networks.href = href 11149 else: 11150 obj.virtual_function_allowed_networks = List(href) 11151 elif rel == "vms": 11152 if obj.vms is not None: 11153 obj.vms.href = href 11154 else: 11155 obj.vms = List(href) 11156 11157 11158class NicConfigurationReader(Reader): 11159 11160 def __init__(self): 11161 super(NicConfigurationReader, self).__init__() 11162 11163 @staticmethod 11164 def read_one(reader): 11165 # Do nothing if there aren't more tags: 11166 if not reader.forward(): 11167 return None 11168 11169 # Create the object: 11170 obj = types.NicConfiguration() 11171 11172 # Process the attributes: 11173 obj.href = reader.get_attribute('href') 11174 11175 # Discard the start tag: 11176 empty = reader.empty_element() 11177 reader.read() 11178 if empty: 11179 return obj 11180 11181 # Process the inner elements: 11182 links = [] 11183 while reader.forward(): 11184 tag = reader.node_name() 11185 if tag == 'boot_protocol': 11186 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11187 elif tag == 'ip': 11188 obj.ip = IpReader.read_one(reader) 11189 elif tag == 'ipv6': 11190 obj.ipv6 = IpReader.read_one(reader) 11191 elif tag == 'ipv6_boot_protocol': 11192 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11193 elif tag == 'name': 11194 obj.name = Reader.read_string(reader) 11195 elif tag == 'on_boot': 11196 obj.on_boot = Reader.read_boolean(reader) 11197 else: 11198 reader.next_element() 11199 for link in links: 11200 NicConfigurationReader._process_link(link, obj) 11201 11202 # Discard the end tag: 11203 reader.read() 11204 11205 return obj 11206 11207 @staticmethod 11208 def read_many(reader): 11209 # Do nothing if there aren't more tags: 11210 objs = List() 11211 if not reader.forward(): 11212 return objs 11213 11214 # Process the attributes: 11215 objs.href = reader.get_attribute('href') 11216 11217 # Discard the start tag: 11218 empty = reader.empty_element() 11219 reader.read() 11220 if empty: 11221 return objs 11222 11223 # Process the inner elements: 11224 while reader.forward(): 11225 objs.append(NicConfigurationReader.read_one(reader)) 11226 11227 # Discard the end tag: 11228 reader.read() 11229 11230 return objs 11231 11232 11233class NumaNodeReader(Reader): 11234 11235 def __init__(self): 11236 super(NumaNodeReader, self).__init__() 11237 11238 @staticmethod 11239 def read_one(reader): 11240 # Do nothing if there aren't more tags: 11241 if not reader.forward(): 11242 return None 11243 11244 # Create the object: 11245 obj = types.NumaNode() 11246 11247 # Process the attributes: 11248 obj.href = reader.get_attribute('href') 11249 value = reader.get_attribute('id') 11250 if value is not None: 11251 obj.id = value 11252 11253 # Discard the start tag: 11254 empty = reader.empty_element() 11255 reader.read() 11256 if empty: 11257 return obj 11258 11259 # Process the inner elements: 11260 links = [] 11261 while reader.forward(): 11262 tag = reader.node_name() 11263 if tag == 'comment': 11264 obj.comment = Reader.read_string(reader) 11265 elif tag == 'cpu': 11266 obj.cpu = CpuReader.read_one(reader) 11267 elif tag == 'description': 11268 obj.description = Reader.read_string(reader) 11269 elif tag == 'host': 11270 obj.host = HostReader.read_one(reader) 11271 elif tag == 'index': 11272 obj.index = Reader.read_integer(reader) 11273 elif tag == 'memory': 11274 obj.memory = Reader.read_integer(reader) 11275 elif tag == 'name': 11276 obj.name = Reader.read_string(reader) 11277 elif tag == 'node_distance': 11278 obj.node_distance = Reader.read_string(reader) 11279 elif tag == 'statistics': 11280 obj.statistics = StatisticReader.read_many(reader) 11281 elif tag == 'link': 11282 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11283 reader.next_element() 11284 else: 11285 reader.next_element() 11286 for link in links: 11287 NumaNodeReader._process_link(link, obj) 11288 11289 # Discard the end tag: 11290 reader.read() 11291 11292 return obj 11293 11294 @staticmethod 11295 def read_many(reader): 11296 # Do nothing if there aren't more tags: 11297 objs = List() 11298 if not reader.forward(): 11299 return objs 11300 11301 # Process the attributes: 11302 objs.href = reader.get_attribute('href') 11303 11304 # Discard the start tag: 11305 empty = reader.empty_element() 11306 reader.read() 11307 if empty: 11308 return objs 11309 11310 # Process the inner elements: 11311 while reader.forward(): 11312 objs.append(NumaNodeReader.read_one(reader)) 11313 11314 # Discard the end tag: 11315 reader.read() 11316 11317 return objs 11318 11319 @staticmethod 11320 def _process_link(link, obj): 11321 # Process the attributes: 11322 rel = link[0] 11323 href = link[1] 11324 if href and rel: 11325 if rel == "statistics": 11326 if obj.statistics is not None: 11327 obj.statistics.href = href 11328 else: 11329 obj.statistics = List(href) 11330 11331 11332class NumaNodePinReader(Reader): 11333 11334 def __init__(self): 11335 super(NumaNodePinReader, self).__init__() 11336 11337 @staticmethod 11338 def read_one(reader): 11339 # Do nothing if there aren't more tags: 11340 if not reader.forward(): 11341 return None 11342 11343 # Create the object: 11344 obj = types.NumaNodePin() 11345 11346 # Process the attributes: 11347 obj.href = reader.get_attribute('href') 11348 11349 # Discard the start tag: 11350 empty = reader.empty_element() 11351 reader.read() 11352 if empty: 11353 return obj 11354 11355 # Process the inner elements: 11356 links = [] 11357 while reader.forward(): 11358 tag = reader.node_name() 11359 if tag == 'host_numa_node': 11360 obj.host_numa_node = NumaNodeReader.read_one(reader) 11361 elif tag == 'index': 11362 obj.index = Reader.read_integer(reader) 11363 elif tag == 'pinned': 11364 obj.pinned = Reader.read_boolean(reader) 11365 else: 11366 reader.next_element() 11367 for link in links: 11368 NumaNodePinReader._process_link(link, obj) 11369 11370 # Discard the end tag: 11371 reader.read() 11372 11373 return obj 11374 11375 @staticmethod 11376 def read_many(reader): 11377 # Do nothing if there aren't more tags: 11378 objs = List() 11379 if not reader.forward(): 11380 return objs 11381 11382 # Process the attributes: 11383 objs.href = reader.get_attribute('href') 11384 11385 # Discard the start tag: 11386 empty = reader.empty_element() 11387 reader.read() 11388 if empty: 11389 return objs 11390 11391 # Process the inner elements: 11392 while reader.forward(): 11393 objs.append(NumaNodePinReader.read_one(reader)) 11394 11395 # Discard the end tag: 11396 reader.read() 11397 11398 return objs 11399 11400 11401class OpenStackImageReader(Reader): 11402 11403 def __init__(self): 11404 super(OpenStackImageReader, self).__init__() 11405 11406 @staticmethod 11407 def read_one(reader): 11408 # Do nothing if there aren't more tags: 11409 if not reader.forward(): 11410 return None 11411 11412 # Create the object: 11413 obj = types.OpenStackImage() 11414 11415 # Process the attributes: 11416 obj.href = reader.get_attribute('href') 11417 value = reader.get_attribute('id') 11418 if value is not None: 11419 obj.id = value 11420 11421 # Discard the start tag: 11422 empty = reader.empty_element() 11423 reader.read() 11424 if empty: 11425 return obj 11426 11427 # Process the inner elements: 11428 links = [] 11429 while reader.forward(): 11430 tag = reader.node_name() 11431 if tag == 'comment': 11432 obj.comment = Reader.read_string(reader) 11433 elif tag == 'description': 11434 obj.description = Reader.read_string(reader) 11435 elif tag == 'name': 11436 obj.name = Reader.read_string(reader) 11437 elif tag == 'openstack_image_provider': 11438 obj.openstack_image_provider = OpenStackImageProviderReader.read_one(reader) 11439 else: 11440 reader.next_element() 11441 for link in links: 11442 OpenStackImageReader._process_link(link, obj) 11443 11444 # Discard the end tag: 11445 reader.read() 11446 11447 return obj 11448 11449 @staticmethod 11450 def read_many(reader): 11451 # Do nothing if there aren't more tags: 11452 objs = List() 11453 if not reader.forward(): 11454 return objs 11455 11456 # Process the attributes: 11457 objs.href = reader.get_attribute('href') 11458 11459 # Discard the start tag: 11460 empty = reader.empty_element() 11461 reader.read() 11462 if empty: 11463 return objs 11464 11465 # Process the inner elements: 11466 while reader.forward(): 11467 objs.append(OpenStackImageReader.read_one(reader)) 11468 11469 # Discard the end tag: 11470 reader.read() 11471 11472 return objs 11473 11474 11475class OpenStackImageProviderReader(Reader): 11476 11477 def __init__(self): 11478 super(OpenStackImageProviderReader, self).__init__() 11479 11480 @staticmethod 11481 def read_one(reader): 11482 # Do nothing if there aren't more tags: 11483 if not reader.forward(): 11484 return None 11485 11486 # Create the object: 11487 obj = types.OpenStackImageProvider() 11488 11489 # Process the attributes: 11490 obj.href = reader.get_attribute('href') 11491 value = reader.get_attribute('id') 11492 if value is not None: 11493 obj.id = value 11494 11495 # Discard the start tag: 11496 empty = reader.empty_element() 11497 reader.read() 11498 if empty: 11499 return obj 11500 11501 # Process the inner elements: 11502 links = [] 11503 while reader.forward(): 11504 tag = reader.node_name() 11505 if tag == 'authentication_url': 11506 obj.authentication_url = Reader.read_string(reader) 11507 elif tag == 'certificates': 11508 obj.certificates = CertificateReader.read_many(reader) 11509 elif tag == 'comment': 11510 obj.comment = Reader.read_string(reader) 11511 elif tag == 'description': 11512 obj.description = Reader.read_string(reader) 11513 elif tag == 'images': 11514 obj.images = OpenStackImageReader.read_many(reader) 11515 elif tag == 'name': 11516 obj.name = Reader.read_string(reader) 11517 elif tag == 'password': 11518 obj.password = Reader.read_string(reader) 11519 elif tag == 'properties': 11520 obj.properties = PropertyReader.read_many(reader) 11521 elif tag == 'requires_authentication': 11522 obj.requires_authentication = Reader.read_boolean(reader) 11523 elif tag == 'tenant_name': 11524 obj.tenant_name = Reader.read_string(reader) 11525 elif tag == 'url': 11526 obj.url = Reader.read_string(reader) 11527 elif tag == 'username': 11528 obj.username = Reader.read_string(reader) 11529 elif tag == 'link': 11530 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11531 reader.next_element() 11532 else: 11533 reader.next_element() 11534 for link in links: 11535 OpenStackImageProviderReader._process_link(link, obj) 11536 11537 # Discard the end tag: 11538 reader.read() 11539 11540 return obj 11541 11542 @staticmethod 11543 def read_many(reader): 11544 # Do nothing if there aren't more tags: 11545 objs = List() 11546 if not reader.forward(): 11547 return objs 11548 11549 # Process the attributes: 11550 objs.href = reader.get_attribute('href') 11551 11552 # Discard the start tag: 11553 empty = reader.empty_element() 11554 reader.read() 11555 if empty: 11556 return objs 11557 11558 # Process the inner elements: 11559 while reader.forward(): 11560 objs.append(OpenStackImageProviderReader.read_one(reader)) 11561 11562 # Discard the end tag: 11563 reader.read() 11564 11565 return objs 11566 11567 @staticmethod 11568 def _process_link(link, obj): 11569 # Process the attributes: 11570 rel = link[0] 11571 href = link[1] 11572 if href and rel: 11573 if rel == "certificates": 11574 if obj.certificates is not None: 11575 obj.certificates.href = href 11576 else: 11577 obj.certificates = List(href) 11578 elif rel == "images": 11579 if obj.images is not None: 11580 obj.images.href = href 11581 else: 11582 obj.images = List(href) 11583 11584 11585class OpenStackNetworkReader(Reader): 11586 11587 def __init__(self): 11588 super(OpenStackNetworkReader, self).__init__() 11589 11590 @staticmethod 11591 def read_one(reader): 11592 # Do nothing if there aren't more tags: 11593 if not reader.forward(): 11594 return None 11595 11596 # Create the object: 11597 obj = types.OpenStackNetwork() 11598 11599 # Process the attributes: 11600 obj.href = reader.get_attribute('href') 11601 value = reader.get_attribute('id') 11602 if value is not None: 11603 obj.id = value 11604 11605 # Discard the start tag: 11606 empty = reader.empty_element() 11607 reader.read() 11608 if empty: 11609 return obj 11610 11611 # Process the inner elements: 11612 links = [] 11613 while reader.forward(): 11614 tag = reader.node_name() 11615 if tag == 'comment': 11616 obj.comment = Reader.read_string(reader) 11617 elif tag == 'description': 11618 obj.description = Reader.read_string(reader) 11619 elif tag == 'name': 11620 obj.name = Reader.read_string(reader) 11621 elif tag == 'openstack_network_provider': 11622 obj.openstack_network_provider = OpenStackNetworkProviderReader.read_one(reader) 11623 else: 11624 reader.next_element() 11625 for link in links: 11626 OpenStackNetworkReader._process_link(link, obj) 11627 11628 # Discard the end tag: 11629 reader.read() 11630 11631 return obj 11632 11633 @staticmethod 11634 def read_many(reader): 11635 # Do nothing if there aren't more tags: 11636 objs = List() 11637 if not reader.forward(): 11638 return objs 11639 11640 # Process the attributes: 11641 objs.href = reader.get_attribute('href') 11642 11643 # Discard the start tag: 11644 empty = reader.empty_element() 11645 reader.read() 11646 if empty: 11647 return objs 11648 11649 # Process the inner elements: 11650 while reader.forward(): 11651 objs.append(OpenStackNetworkReader.read_one(reader)) 11652 11653 # Discard the end tag: 11654 reader.read() 11655 11656 return objs 11657 11658 11659class OpenStackNetworkProviderReader(Reader): 11660 11661 def __init__(self): 11662 super(OpenStackNetworkProviderReader, self).__init__() 11663 11664 @staticmethod 11665 def read_one(reader): 11666 # Do nothing if there aren't more tags: 11667 if not reader.forward(): 11668 return None 11669 11670 # Create the object: 11671 obj = types.OpenStackNetworkProvider() 11672 11673 # Process the attributes: 11674 obj.href = reader.get_attribute('href') 11675 value = reader.get_attribute('id') 11676 if value is not None: 11677 obj.id = value 11678 11679 # Discard the start tag: 11680 empty = reader.empty_element() 11681 reader.read() 11682 if empty: 11683 return obj 11684 11685 # Process the inner elements: 11686 links = [] 11687 while reader.forward(): 11688 tag = reader.node_name() 11689 if tag == 'agent_configuration': 11690 obj.agent_configuration = AgentConfigurationReader.read_one(reader) 11691 elif tag == 'authentication_url': 11692 obj.authentication_url = Reader.read_string(reader) 11693 elif tag == 'auto_sync': 11694 obj.auto_sync = Reader.read_boolean(reader) 11695 elif tag == 'certificates': 11696 obj.certificates = CertificateReader.read_many(reader) 11697 elif tag == 'comment': 11698 obj.comment = Reader.read_string(reader) 11699 elif tag == 'description': 11700 obj.description = Reader.read_string(reader) 11701 elif tag == 'external_plugin_type': 11702 obj.external_plugin_type = Reader.read_string(reader) 11703 elif tag == 'name': 11704 obj.name = Reader.read_string(reader) 11705 elif tag == 'networks': 11706 obj.networks = OpenStackNetworkReader.read_many(reader) 11707 elif tag == 'password': 11708 obj.password = Reader.read_string(reader) 11709 elif tag == 'plugin_type': 11710 obj.plugin_type = Reader.read_enum(types.NetworkPluginType, reader) 11711 elif tag == 'project_domain_name': 11712 obj.project_domain_name = Reader.read_string(reader) 11713 elif tag == 'project_name': 11714 obj.project_name = Reader.read_string(reader) 11715 elif tag == 'properties': 11716 obj.properties = PropertyReader.read_many(reader) 11717 elif tag == 'read_only': 11718 obj.read_only = Reader.read_boolean(reader) 11719 elif tag == 'requires_authentication': 11720 obj.requires_authentication = Reader.read_boolean(reader) 11721 elif tag == 'subnets': 11722 obj.subnets = OpenStackSubnetReader.read_many(reader) 11723 elif tag == 'tenant_name': 11724 obj.tenant_name = Reader.read_string(reader) 11725 elif tag == 'type': 11726 obj.type = Reader.read_enum(types.OpenStackNetworkProviderType, reader) 11727 elif tag == 'unmanaged': 11728 obj.unmanaged = Reader.read_boolean(reader) 11729 elif tag == 'url': 11730 obj.url = Reader.read_string(reader) 11731 elif tag == 'user_domain_name': 11732 obj.user_domain_name = Reader.read_string(reader) 11733 elif tag == 'username': 11734 obj.username = Reader.read_string(reader) 11735 elif tag == 'link': 11736 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11737 reader.next_element() 11738 else: 11739 reader.next_element() 11740 for link in links: 11741 OpenStackNetworkProviderReader._process_link(link, obj) 11742 11743 # Discard the end tag: 11744 reader.read() 11745 11746 return obj 11747 11748 @staticmethod 11749 def read_many(reader): 11750 # Do nothing if there aren't more tags: 11751 objs = List() 11752 if not reader.forward(): 11753 return objs 11754 11755 # Process the attributes: 11756 objs.href = reader.get_attribute('href') 11757 11758 # Discard the start tag: 11759 empty = reader.empty_element() 11760 reader.read() 11761 if empty: 11762 return objs 11763 11764 # Process the inner elements: 11765 while reader.forward(): 11766 objs.append(OpenStackNetworkProviderReader.read_one(reader)) 11767 11768 # Discard the end tag: 11769 reader.read() 11770 11771 return objs 11772 11773 @staticmethod 11774 def _process_link(link, obj): 11775 # Process the attributes: 11776 rel = link[0] 11777 href = link[1] 11778 if href and rel: 11779 if rel == "certificates": 11780 if obj.certificates is not None: 11781 obj.certificates.href = href 11782 else: 11783 obj.certificates = List(href) 11784 elif rel == "networks": 11785 if obj.networks is not None: 11786 obj.networks.href = href 11787 else: 11788 obj.networks = List(href) 11789 elif rel == "subnets": 11790 if obj.subnets is not None: 11791 obj.subnets.href = href 11792 else: 11793 obj.subnets = List(href) 11794 11795 11796class OpenStackProviderReader(Reader): 11797 11798 def __init__(self): 11799 super(OpenStackProviderReader, self).__init__() 11800 11801 @staticmethod 11802 def read_one(reader): 11803 # Do nothing if there aren't more tags: 11804 if not reader.forward(): 11805 return None 11806 11807 # Create the object: 11808 obj = types.OpenStackProvider() 11809 11810 # Process the attributes: 11811 obj.href = reader.get_attribute('href') 11812 value = reader.get_attribute('id') 11813 if value is not None: 11814 obj.id = value 11815 11816 # Discard the start tag: 11817 empty = reader.empty_element() 11818 reader.read() 11819 if empty: 11820 return obj 11821 11822 # Process the inner elements: 11823 links = [] 11824 while reader.forward(): 11825 tag = reader.node_name() 11826 if tag == 'authentication_url': 11827 obj.authentication_url = Reader.read_string(reader) 11828 elif tag == 'comment': 11829 obj.comment = Reader.read_string(reader) 11830 elif tag == 'description': 11831 obj.description = Reader.read_string(reader) 11832 elif tag == 'name': 11833 obj.name = Reader.read_string(reader) 11834 elif tag == 'password': 11835 obj.password = Reader.read_string(reader) 11836 elif tag == 'properties': 11837 obj.properties = PropertyReader.read_many(reader) 11838 elif tag == 'requires_authentication': 11839 obj.requires_authentication = Reader.read_boolean(reader) 11840 elif tag == 'tenant_name': 11841 obj.tenant_name = Reader.read_string(reader) 11842 elif tag == 'url': 11843 obj.url = Reader.read_string(reader) 11844 elif tag == 'username': 11845 obj.username = Reader.read_string(reader) 11846 else: 11847 reader.next_element() 11848 for link in links: 11849 OpenStackProviderReader._process_link(link, obj) 11850 11851 # Discard the end tag: 11852 reader.read() 11853 11854 return obj 11855 11856 @staticmethod 11857 def read_many(reader): 11858 # Do nothing if there aren't more tags: 11859 objs = List() 11860 if not reader.forward(): 11861 return objs 11862 11863 # Process the attributes: 11864 objs.href = reader.get_attribute('href') 11865 11866 # Discard the start tag: 11867 empty = reader.empty_element() 11868 reader.read() 11869 if empty: 11870 return objs 11871 11872 # Process the inner elements: 11873 while reader.forward(): 11874 objs.append(OpenStackProviderReader.read_one(reader)) 11875 11876 # Discard the end tag: 11877 reader.read() 11878 11879 return objs 11880 11881 11882class OpenStackSubnetReader(Reader): 11883 11884 def __init__(self): 11885 super(OpenStackSubnetReader, self).__init__() 11886 11887 @staticmethod 11888 def read_one(reader): 11889 # Do nothing if there aren't more tags: 11890 if not reader.forward(): 11891 return None 11892 11893 # Create the object: 11894 obj = types.OpenStackSubnet() 11895 11896 # Process the attributes: 11897 obj.href = reader.get_attribute('href') 11898 value = reader.get_attribute('id') 11899 if value is not None: 11900 obj.id = value 11901 11902 # Discard the start tag: 11903 empty = reader.empty_element() 11904 reader.read() 11905 if empty: 11906 return obj 11907 11908 # Process the inner elements: 11909 links = [] 11910 while reader.forward(): 11911 tag = reader.node_name() 11912 if tag == 'cidr': 11913 obj.cidr = Reader.read_string(reader) 11914 elif tag == 'comment': 11915 obj.comment = Reader.read_string(reader) 11916 elif tag == 'description': 11917 obj.description = Reader.read_string(reader) 11918 elif tag == 'dns_servers': 11919 obj.dns_servers = Reader.read_strings(reader) 11920 elif tag == 'gateway': 11921 obj.gateway = Reader.read_string(reader) 11922 elif tag == 'ip_version': 11923 obj.ip_version = Reader.read_string(reader) 11924 elif tag == 'name': 11925 obj.name = Reader.read_string(reader) 11926 elif tag == 'openstack_network': 11927 obj.openstack_network = OpenStackNetworkReader.read_one(reader) 11928 else: 11929 reader.next_element() 11930 for link in links: 11931 OpenStackSubnetReader._process_link(link, obj) 11932 11933 # Discard the end tag: 11934 reader.read() 11935 11936 return obj 11937 11938 @staticmethod 11939 def read_many(reader): 11940 # Do nothing if there aren't more tags: 11941 objs = List() 11942 if not reader.forward(): 11943 return objs 11944 11945 # Process the attributes: 11946 objs.href = reader.get_attribute('href') 11947 11948 # Discard the start tag: 11949 empty = reader.empty_element() 11950 reader.read() 11951 if empty: 11952 return objs 11953 11954 # Process the inner elements: 11955 while reader.forward(): 11956 objs.append(OpenStackSubnetReader.read_one(reader)) 11957 11958 # Discard the end tag: 11959 reader.read() 11960 11961 return objs 11962 11963 11964class OpenStackVolumeProviderReader(Reader): 11965 11966 def __init__(self): 11967 super(OpenStackVolumeProviderReader, self).__init__() 11968 11969 @staticmethod 11970 def read_one(reader): 11971 # Do nothing if there aren't more tags: 11972 if not reader.forward(): 11973 return None 11974 11975 # Create the object: 11976 obj = types.OpenStackVolumeProvider() 11977 11978 # Process the attributes: 11979 obj.href = reader.get_attribute('href') 11980 value = reader.get_attribute('id') 11981 if value is not None: 11982 obj.id = value 11983 11984 # Discard the start tag: 11985 empty = reader.empty_element() 11986 reader.read() 11987 if empty: 11988 return obj 11989 11990 # Process the inner elements: 11991 links = [] 11992 while reader.forward(): 11993 tag = reader.node_name() 11994 if tag == 'authentication_keys': 11995 obj.authentication_keys = OpenstackVolumeAuthenticationKeyReader.read_many(reader) 11996 elif tag == 'authentication_url': 11997 obj.authentication_url = Reader.read_string(reader) 11998 elif tag == 'certificates': 11999 obj.certificates = CertificateReader.read_many(reader) 12000 elif tag == 'comment': 12001 obj.comment = Reader.read_string(reader) 12002 elif tag == 'data_center': 12003 obj.data_center = DataCenterReader.read_one(reader) 12004 elif tag == 'description': 12005 obj.description = Reader.read_string(reader) 12006 elif tag == 'name': 12007 obj.name = Reader.read_string(reader) 12008 elif tag == 'password': 12009 obj.password = Reader.read_string(reader) 12010 elif tag == 'properties': 12011 obj.properties = PropertyReader.read_many(reader) 12012 elif tag == 'requires_authentication': 12013 obj.requires_authentication = Reader.read_boolean(reader) 12014 elif tag == 'tenant_name': 12015 obj.tenant_name = Reader.read_string(reader) 12016 elif tag == 'url': 12017 obj.url = Reader.read_string(reader) 12018 elif tag == 'username': 12019 obj.username = Reader.read_string(reader) 12020 elif tag == 'volume_types': 12021 obj.volume_types = OpenStackVolumeTypeReader.read_many(reader) 12022 elif tag == 'link': 12023 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 12024 reader.next_element() 12025 else: 12026 reader.next_element() 12027 for link in links: 12028 OpenStackVolumeProviderReader._process_link(link, obj) 12029 12030 # Discard the end tag: 12031 reader.read() 12032 12033 return obj 12034 12035 @staticmethod 12036 def read_many(reader): 12037 # Do nothing if there aren't more tags: 12038 objs = List() 12039 if not reader.forward(): 12040 return objs 12041 12042 # Process the attributes: 12043 objs.href = reader.get_attribute('href') 12044 12045 # Discard the start tag: 12046 empty = reader.empty_element() 12047 reader.read() 12048 if empty: 12049 return objs 12050 12051 # Process the inner elements: 12052 while reader.forward(): 12053 objs.append(OpenStackVolumeProviderReader.read_one(reader)) 12054 12055 # Discard the end tag: 12056 reader.read() 12057 12058 return objs 12059 12060 @staticmethod 12061 def _process_link(link, obj): 12062 # Process the attributes: 12063 rel = link[0] 12064 href = link[1] 12065 if href and rel: 12066 if rel == "authenticationkeys": 12067 if obj.authentication_keys is not None: 12068 obj.authentication_keys.href = href 12069 else: 12070 obj.authentication_keys = List(href) 12071 elif rel == "certificates": 12072 if obj.certificates is not None: 12073 obj.certificates.href = href 12074 else: 12075 obj.certificates = List(href) 12076 elif rel == "volumetypes": 12077 if obj.volume_types is not None: 12078 obj.volume_types.href = href 12079 else: 12080 obj.volume_types = List(href) 12081 12082 12083class OpenStackVolumeTypeReader(Reader): 12084 12085 def __init__(self): 12086 super(OpenStackVolumeTypeReader, self).__init__() 12087 12088 @staticmethod 12089 def read_one(reader): 12090 # Do nothing if there aren't more tags: 12091 if not reader.forward(): 12092 return None 12093 12094 # Create the object: 12095 obj = types.OpenStackVolumeType() 12096 12097 # Process the attributes: 12098 obj.href = reader.get_attribute('href') 12099 value = reader.get_attribute('id') 12100 if value is not None: 12101 obj.id = value 12102 12103 # Discard the start tag: 12104 empty = reader.empty_element() 12105 reader.read() 12106 if empty: 12107 return obj 12108 12109 # Process the inner elements: 12110 links = [] 12111 while reader.forward(): 12112 tag = reader.node_name() 12113 if tag == 'comment': 12114 obj.comment = Reader.read_string(reader) 12115 elif tag == 'description': 12116 obj.description = Reader.read_string(reader) 12117 elif tag == 'name': 12118 obj.name = Reader.read_string(reader) 12119 elif tag == 'openstack_volume_provider': 12120 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12121 elif tag == 'properties': 12122 obj.properties = PropertyReader.read_many(reader) 12123 else: 12124 reader.next_element() 12125 for link in links: 12126 OpenStackVolumeTypeReader._process_link(link, obj) 12127 12128 # Discard the end tag: 12129 reader.read() 12130 12131 return obj 12132 12133 @staticmethod 12134 def read_many(reader): 12135 # Do nothing if there aren't more tags: 12136 objs = List() 12137 if not reader.forward(): 12138 return objs 12139 12140 # Process the attributes: 12141 objs.href = reader.get_attribute('href') 12142 12143 # Discard the start tag: 12144 empty = reader.empty_element() 12145 reader.read() 12146 if empty: 12147 return objs 12148 12149 # Process the inner elements: 12150 while reader.forward(): 12151 objs.append(OpenStackVolumeTypeReader.read_one(reader)) 12152 12153 # Discard the end tag: 12154 reader.read() 12155 12156 return objs 12157 12158 12159class OpenstackVolumeAuthenticationKeyReader(Reader): 12160 12161 def __init__(self): 12162 super(OpenstackVolumeAuthenticationKeyReader, self).__init__() 12163 12164 @staticmethod 12165 def read_one(reader): 12166 # Do nothing if there aren't more tags: 12167 if not reader.forward(): 12168 return None 12169 12170 # Create the object: 12171 obj = types.OpenstackVolumeAuthenticationKey() 12172 12173 # Process the attributes: 12174 obj.href = reader.get_attribute('href') 12175 value = reader.get_attribute('id') 12176 if value is not None: 12177 obj.id = value 12178 12179 # Discard the start tag: 12180 empty = reader.empty_element() 12181 reader.read() 12182 if empty: 12183 return obj 12184 12185 # Process the inner elements: 12186 links = [] 12187 while reader.forward(): 12188 tag = reader.node_name() 12189 if tag == 'comment': 12190 obj.comment = Reader.read_string(reader) 12191 elif tag == 'creation_date': 12192 obj.creation_date = Reader.read_date(reader) 12193 elif tag == 'description': 12194 obj.description = Reader.read_string(reader) 12195 elif tag == 'name': 12196 obj.name = Reader.read_string(reader) 12197 elif tag == 'openstack_volume_provider': 12198 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12199 elif tag == 'usage_type': 12200 obj.usage_type = Reader.read_enum(types.OpenstackVolumeAuthenticationKeyUsageType, reader) 12201 elif tag == 'uuid': 12202 obj.uuid = Reader.read_string(reader) 12203 elif tag == 'value': 12204 obj.value = Reader.read_string(reader) 12205 else: 12206 reader.next_element() 12207 for link in links: 12208 OpenstackVolumeAuthenticationKeyReader._process_link(link, obj) 12209 12210 # Discard the end tag: 12211 reader.read() 12212 12213 return obj 12214 12215 @staticmethod 12216 def read_many(reader): 12217 # Do nothing if there aren't more tags: 12218 objs = List() 12219 if not reader.forward(): 12220 return objs 12221 12222 # Process the attributes: 12223 objs.href = reader.get_attribute('href') 12224 12225 # Discard the start tag: 12226 empty = reader.empty_element() 12227 reader.read() 12228 if empty: 12229 return objs 12230 12231 # Process the inner elements: 12232 while reader.forward(): 12233 objs.append(OpenstackVolumeAuthenticationKeyReader.read_one(reader)) 12234 12235 # Discard the end tag: 12236 reader.read() 12237 12238 return objs 12239 12240 12241class OperatingSystemReader(Reader): 12242 12243 def __init__(self): 12244 super(OperatingSystemReader, self).__init__() 12245 12246 @staticmethod 12247 def read_one(reader): 12248 # Do nothing if there aren't more tags: 12249 if not reader.forward(): 12250 return None 12251 12252 # Create the object: 12253 obj = types.OperatingSystem() 12254 12255 # Process the attributes: 12256 obj.href = reader.get_attribute('href') 12257 12258 # Discard the start tag: 12259 empty = reader.empty_element() 12260 reader.read() 12261 if empty: 12262 return obj 12263 12264 # Process the inner elements: 12265 links = [] 12266 while reader.forward(): 12267 tag = reader.node_name() 12268 if tag == 'boot': 12269 obj.boot = BootReader.read_one(reader) 12270 elif tag == 'cmdline': 12271 obj.cmdline = Reader.read_string(reader) 12272 elif tag == 'custom_kernel_cmdline': 12273 obj.custom_kernel_cmdline = Reader.read_string(reader) 12274 elif tag == 'initrd': 12275 obj.initrd = Reader.read_string(reader) 12276 elif tag == 'kernel': 12277 obj.kernel = Reader.read_string(reader) 12278 elif tag == 'reported_kernel_cmdline': 12279 obj.reported_kernel_cmdline = Reader.read_string(reader) 12280 elif tag == 'type': 12281 obj.type = Reader.read_string(reader) 12282 elif tag == 'version': 12283 obj.version = VersionReader.read_one(reader) 12284 else: 12285 reader.next_element() 12286 for link in links: 12287 OperatingSystemReader._process_link(link, obj) 12288 12289 # Discard the end tag: 12290 reader.read() 12291 12292 return obj 12293 12294 @staticmethod 12295 def read_many(reader): 12296 # Do nothing if there aren't more tags: 12297 objs = List() 12298 if not reader.forward(): 12299 return objs 12300 12301 # Process the attributes: 12302 objs.href = reader.get_attribute('href') 12303 12304 # Discard the start tag: 12305 empty = reader.empty_element() 12306 reader.read() 12307 if empty: 12308 return objs 12309 12310 # Process the inner elements: 12311 while reader.forward(): 12312 objs.append(OperatingSystemReader.read_one(reader)) 12313 12314 # Discard the end tag: 12315 reader.read() 12316 12317 return objs 12318 12319 12320class OperatingSystemInfoReader(Reader): 12321 12322 def __init__(self): 12323 super(OperatingSystemInfoReader, self).__init__() 12324 12325 @staticmethod 12326 def read_one(reader): 12327 # Do nothing if there aren't more tags: 12328 if not reader.forward(): 12329 return None 12330 12331 # Create the object: 12332 obj = types.OperatingSystemInfo() 12333 12334 # Process the attributes: 12335 obj.href = reader.get_attribute('href') 12336 value = reader.get_attribute('id') 12337 if value is not None: 12338 obj.id = value 12339 12340 # Discard the start tag: 12341 empty = reader.empty_element() 12342 reader.read() 12343 if empty: 12344 return obj 12345 12346 # Process the inner elements: 12347 links = [] 12348 while reader.forward(): 12349 tag = reader.node_name() 12350 if tag == 'architecture': 12351 obj.architecture = Reader.read_enum(types.Architecture, reader) 12352 elif tag == 'comment': 12353 obj.comment = Reader.read_string(reader) 12354 elif tag == 'description': 12355 obj.description = Reader.read_string(reader) 12356 elif tag == 'large_icon': 12357 obj.large_icon = IconReader.read_one(reader) 12358 elif tag == 'name': 12359 obj.name = Reader.read_string(reader) 12360 elif tag == 'small_icon': 12361 obj.small_icon = IconReader.read_one(reader) 12362 else: 12363 reader.next_element() 12364 for link in links: 12365 OperatingSystemInfoReader._process_link(link, obj) 12366 12367 # Discard the end tag: 12368 reader.read() 12369 12370 return obj 12371 12372 @staticmethod 12373 def read_many(reader): 12374 # Do nothing if there aren't more tags: 12375 objs = List() 12376 if not reader.forward(): 12377 return objs 12378 12379 # Process the attributes: 12380 objs.href = reader.get_attribute('href') 12381 12382 # Discard the start tag: 12383 empty = reader.empty_element() 12384 reader.read() 12385 if empty: 12386 return objs 12387 12388 # Process the inner elements: 12389 while reader.forward(): 12390 objs.append(OperatingSystemInfoReader.read_one(reader)) 12391 12392 # Discard the end tag: 12393 reader.read() 12394 12395 return objs 12396 12397 12398class OptionReader(Reader): 12399 12400 def __init__(self): 12401 super(OptionReader, self).__init__() 12402 12403 @staticmethod 12404 def read_one(reader): 12405 # Do nothing if there aren't more tags: 12406 if not reader.forward(): 12407 return None 12408 12409 # Create the object: 12410 obj = types.Option() 12411 12412 # Process the attributes: 12413 obj.href = reader.get_attribute('href') 12414 12415 # Discard the start tag: 12416 empty = reader.empty_element() 12417 reader.read() 12418 if empty: 12419 return obj 12420 12421 # Process the inner elements: 12422 links = [] 12423 while reader.forward(): 12424 tag = reader.node_name() 12425 if tag == 'name': 12426 obj.name = Reader.read_string(reader) 12427 elif tag == 'type': 12428 obj.type = Reader.read_string(reader) 12429 elif tag == 'value': 12430 obj.value = Reader.read_string(reader) 12431 else: 12432 reader.next_element() 12433 for link in links: 12434 OptionReader._process_link(link, obj) 12435 12436 # Discard the end tag: 12437 reader.read() 12438 12439 return obj 12440 12441 @staticmethod 12442 def read_many(reader): 12443 # Do nothing if there aren't more tags: 12444 objs = List() 12445 if not reader.forward(): 12446 return objs 12447 12448 # Process the attributes: 12449 objs.href = reader.get_attribute('href') 12450 12451 # Discard the start tag: 12452 empty = reader.empty_element() 12453 reader.read() 12454 if empty: 12455 return objs 12456 12457 # Process the inner elements: 12458 while reader.forward(): 12459 objs.append(OptionReader.read_one(reader)) 12460 12461 # Discard the end tag: 12462 reader.read() 12463 12464 return objs 12465 12466 12467class PackageReader(Reader): 12468 12469 def __init__(self): 12470 super(PackageReader, self).__init__() 12471 12472 @staticmethod 12473 def read_one(reader): 12474 # Do nothing if there aren't more tags: 12475 if not reader.forward(): 12476 return None 12477 12478 # Create the object: 12479 obj = types.Package() 12480 12481 # Process the attributes: 12482 obj.href = reader.get_attribute('href') 12483 12484 # Discard the start tag: 12485 empty = reader.empty_element() 12486 reader.read() 12487 if empty: 12488 return obj 12489 12490 # Process the inner elements: 12491 links = [] 12492 while reader.forward(): 12493 tag = reader.node_name() 12494 if tag == 'name': 12495 obj.name = Reader.read_string(reader) 12496 else: 12497 reader.next_element() 12498 for link in links: 12499 PackageReader._process_link(link, obj) 12500 12501 # Discard the end tag: 12502 reader.read() 12503 12504 return obj 12505 12506 @staticmethod 12507 def read_many(reader): 12508 # Do nothing if there aren't more tags: 12509 objs = List() 12510 if not reader.forward(): 12511 return objs 12512 12513 # Process the attributes: 12514 objs.href = reader.get_attribute('href') 12515 12516 # Discard the start tag: 12517 empty = reader.empty_element() 12518 reader.read() 12519 if empty: 12520 return objs 12521 12522 # Process the inner elements: 12523 while reader.forward(): 12524 objs.append(PackageReader.read_one(reader)) 12525 12526 # Discard the end tag: 12527 reader.read() 12528 12529 return objs 12530 12531 12532class PayloadReader(Reader): 12533 12534 def __init__(self): 12535 super(PayloadReader, self).__init__() 12536 12537 @staticmethod 12538 def read_one(reader): 12539 # Do nothing if there aren't more tags: 12540 if not reader.forward(): 12541 return None 12542 12543 # Create the object: 12544 obj = types.Payload() 12545 12546 # Process the attributes: 12547 obj.href = reader.get_attribute('href') 12548 12549 # Discard the start tag: 12550 empty = reader.empty_element() 12551 reader.read() 12552 if empty: 12553 return obj 12554 12555 # Process the inner elements: 12556 links = [] 12557 while reader.forward(): 12558 tag = reader.node_name() 12559 if tag == 'files': 12560 obj.files = FileReader.read_many(reader) 12561 elif tag == 'type': 12562 obj.type = Reader.read_enum(types.VmDeviceType, reader) 12563 elif tag == 'volume_id': 12564 obj.volume_id = Reader.read_string(reader) 12565 else: 12566 reader.next_element() 12567 for link in links: 12568 PayloadReader._process_link(link, obj) 12569 12570 # Discard the end tag: 12571 reader.read() 12572 12573 return obj 12574 12575 @staticmethod 12576 def read_many(reader): 12577 # Do nothing if there aren't more tags: 12578 objs = List() 12579 if not reader.forward(): 12580 return objs 12581 12582 # Process the attributes: 12583 objs.href = reader.get_attribute('href') 12584 12585 # Discard the start tag: 12586 empty = reader.empty_element() 12587 reader.read() 12588 if empty: 12589 return objs 12590 12591 # Process the inner elements: 12592 while reader.forward(): 12593 objs.append(PayloadReader.read_one(reader)) 12594 12595 # Discard the end tag: 12596 reader.read() 12597 12598 return objs 12599 12600 12601class PermissionReader(Reader): 12602 12603 def __init__(self): 12604 super(PermissionReader, self).__init__() 12605 12606 @staticmethod 12607 def read_one(reader): 12608 # Do nothing if there aren't more tags: 12609 if not reader.forward(): 12610 return None 12611 12612 # Create the object: 12613 obj = types.Permission() 12614 12615 # Process the attributes: 12616 obj.href = reader.get_attribute('href') 12617 value = reader.get_attribute('id') 12618 if value is not None: 12619 obj.id = value 12620 12621 # Discard the start tag: 12622 empty = reader.empty_element() 12623 reader.read() 12624 if empty: 12625 return obj 12626 12627 # Process the inner elements: 12628 links = [] 12629 while reader.forward(): 12630 tag = reader.node_name() 12631 if tag == 'cluster': 12632 obj.cluster = ClusterReader.read_one(reader) 12633 elif tag == 'comment': 12634 obj.comment = Reader.read_string(reader) 12635 elif tag == 'data_center': 12636 obj.data_center = DataCenterReader.read_one(reader) 12637 elif tag == 'description': 12638 obj.description = Reader.read_string(reader) 12639 elif tag == 'disk': 12640 obj.disk = DiskReader.read_one(reader) 12641 elif tag == 'group': 12642 obj.group = GroupReader.read_one(reader) 12643 elif tag == 'host': 12644 obj.host = HostReader.read_one(reader) 12645 elif tag == 'name': 12646 obj.name = Reader.read_string(reader) 12647 elif tag == 'role': 12648 obj.role = RoleReader.read_one(reader) 12649 elif tag == 'storage_domain': 12650 obj.storage_domain = StorageDomainReader.read_one(reader) 12651 elif tag == 'template': 12652 obj.template = TemplateReader.read_one(reader) 12653 elif tag == 'user': 12654 obj.user = UserReader.read_one(reader) 12655 elif tag == 'vm': 12656 obj.vm = VmReader.read_one(reader) 12657 elif tag == 'vm_pool': 12658 obj.vm_pool = VmPoolReader.read_one(reader) 12659 else: 12660 reader.next_element() 12661 for link in links: 12662 PermissionReader._process_link(link, obj) 12663 12664 # Discard the end tag: 12665 reader.read() 12666 12667 return obj 12668 12669 @staticmethod 12670 def read_many(reader): 12671 # Do nothing if there aren't more tags: 12672 objs = List() 12673 if not reader.forward(): 12674 return objs 12675 12676 # Process the attributes: 12677 objs.href = reader.get_attribute('href') 12678 12679 # Discard the start tag: 12680 empty = reader.empty_element() 12681 reader.read() 12682 if empty: 12683 return objs 12684 12685 # Process the inner elements: 12686 while reader.forward(): 12687 objs.append(PermissionReader.read_one(reader)) 12688 12689 # Discard the end tag: 12690 reader.read() 12691 12692 return objs 12693 12694 12695class PermitReader(Reader): 12696 12697 def __init__(self): 12698 super(PermitReader, self).__init__() 12699 12700 @staticmethod 12701 def read_one(reader): 12702 # Do nothing if there aren't more tags: 12703 if not reader.forward(): 12704 return None 12705 12706 # Create the object: 12707 obj = types.Permit() 12708 12709 # Process the attributes: 12710 obj.href = reader.get_attribute('href') 12711 value = reader.get_attribute('id') 12712 if value is not None: 12713 obj.id = value 12714 12715 # Discard the start tag: 12716 empty = reader.empty_element() 12717 reader.read() 12718 if empty: 12719 return obj 12720 12721 # Process the inner elements: 12722 links = [] 12723 while reader.forward(): 12724 tag = reader.node_name() 12725 if tag == 'administrative': 12726 obj.administrative = Reader.read_boolean(reader) 12727 elif tag == 'comment': 12728 obj.comment = Reader.read_string(reader) 12729 elif tag == 'description': 12730 obj.description = Reader.read_string(reader) 12731 elif tag == 'name': 12732 obj.name = Reader.read_string(reader) 12733 elif tag == 'role': 12734 obj.role = RoleReader.read_one(reader) 12735 else: 12736 reader.next_element() 12737 for link in links: 12738 PermitReader._process_link(link, obj) 12739 12740 # Discard the end tag: 12741 reader.read() 12742 12743 return obj 12744 12745 @staticmethod 12746 def read_many(reader): 12747 # Do nothing if there aren't more tags: 12748 objs = List() 12749 if not reader.forward(): 12750 return objs 12751 12752 # Process the attributes: 12753 objs.href = reader.get_attribute('href') 12754 12755 # Discard the start tag: 12756 empty = reader.empty_element() 12757 reader.read() 12758 if empty: 12759 return objs 12760 12761 # Process the inner elements: 12762 while reader.forward(): 12763 objs.append(PermitReader.read_one(reader)) 12764 12765 # Discard the end tag: 12766 reader.read() 12767 12768 return objs 12769 12770 12771class PmProxyReader(Reader): 12772 12773 def __init__(self): 12774 super(PmProxyReader, self).__init__() 12775 12776 @staticmethod 12777 def read_one(reader): 12778 # Do nothing if there aren't more tags: 12779 if not reader.forward(): 12780 return None 12781 12782 # Create the object: 12783 obj = types.PmProxy() 12784 12785 # Process the attributes: 12786 obj.href = reader.get_attribute('href') 12787 12788 # Discard the start tag: 12789 empty = reader.empty_element() 12790 reader.read() 12791 if empty: 12792 return obj 12793 12794 # Process the inner elements: 12795 links = [] 12796 while reader.forward(): 12797 tag = reader.node_name() 12798 if tag == 'type': 12799 obj.type = Reader.read_enum(types.PmProxyType, reader) 12800 else: 12801 reader.next_element() 12802 for link in links: 12803 PmProxyReader._process_link(link, obj) 12804 12805 # Discard the end tag: 12806 reader.read() 12807 12808 return obj 12809 12810 @staticmethod 12811 def read_many(reader): 12812 # Do nothing if there aren't more tags: 12813 objs = List() 12814 if not reader.forward(): 12815 return objs 12816 12817 # Process the attributes: 12818 objs.href = reader.get_attribute('href') 12819 12820 # Discard the start tag: 12821 empty = reader.empty_element() 12822 reader.read() 12823 if empty: 12824 return objs 12825 12826 # Process the inner elements: 12827 while reader.forward(): 12828 objs.append(PmProxyReader.read_one(reader)) 12829 12830 # Discard the end tag: 12831 reader.read() 12832 12833 return objs 12834 12835 12836class PortMirroringReader(Reader): 12837 12838 def __init__(self): 12839 super(PortMirroringReader, self).__init__() 12840 12841 @staticmethod 12842 def read_one(reader): 12843 # Do nothing if there aren't more tags: 12844 if not reader.forward(): 12845 return None 12846 12847 # Create the object: 12848 obj = types.PortMirroring() 12849 12850 # Process the attributes: 12851 obj.href = reader.get_attribute('href') 12852 12853 # Discard the start tag: 12854 empty = reader.empty_element() 12855 reader.read() 12856 if empty: 12857 return obj 12858 12859 # Process the inner elements: 12860 reader.next_element() 12861 12862 # Discard the end tag: 12863 reader.read() 12864 12865 return obj 12866 12867 @staticmethod 12868 def read_many(reader): 12869 # Do nothing if there aren't more tags: 12870 objs = List() 12871 if not reader.forward(): 12872 return objs 12873 12874 # Process the attributes: 12875 objs.href = reader.get_attribute('href') 12876 12877 # Discard the start tag: 12878 empty = reader.empty_element() 12879 reader.read() 12880 if empty: 12881 return objs 12882 12883 # Process the inner elements: 12884 while reader.forward(): 12885 objs.append(PortMirroringReader.read_one(reader)) 12886 12887 # Discard the end tag: 12888 reader.read() 12889 12890 return objs 12891 12892 12893class PowerManagementReader(Reader): 12894 12895 def __init__(self): 12896 super(PowerManagementReader, self).__init__() 12897 12898 @staticmethod 12899 def read_one(reader): 12900 # Do nothing if there aren't more tags: 12901 if not reader.forward(): 12902 return None 12903 12904 # Create the object: 12905 obj = types.PowerManagement() 12906 12907 # Process the attributes: 12908 obj.href = reader.get_attribute('href') 12909 12910 # Discard the start tag: 12911 empty = reader.empty_element() 12912 reader.read() 12913 if empty: 12914 return obj 12915 12916 # Process the inner elements: 12917 links = [] 12918 while reader.forward(): 12919 tag = reader.node_name() 12920 if tag == 'address': 12921 obj.address = Reader.read_string(reader) 12922 elif tag == 'agents': 12923 obj.agents = AgentReader.read_many(reader) 12924 elif tag == 'automatic_pm_enabled': 12925 obj.automatic_pm_enabled = Reader.read_boolean(reader) 12926 elif tag == 'enabled': 12927 obj.enabled = Reader.read_boolean(reader) 12928 elif tag == 'kdump_detection': 12929 obj.kdump_detection = Reader.read_boolean(reader) 12930 elif tag == 'options': 12931 obj.options = OptionReader.read_many(reader) 12932 elif tag == 'password': 12933 obj.password = Reader.read_string(reader) 12934 elif tag == 'pm_proxies': 12935 obj.pm_proxies = PmProxyReader.read_many(reader) 12936 elif tag == 'status': 12937 obj.status = Reader.read_enum(types.PowerManagementStatus, reader) 12938 elif tag == 'type': 12939 obj.type = Reader.read_string(reader) 12940 elif tag == 'username': 12941 obj.username = Reader.read_string(reader) 12942 else: 12943 reader.next_element() 12944 for link in links: 12945 PowerManagementReader._process_link(link, obj) 12946 12947 # Discard the end tag: 12948 reader.read() 12949 12950 return obj 12951 12952 @staticmethod 12953 def read_many(reader): 12954 # Do nothing if there aren't more tags: 12955 objs = List() 12956 if not reader.forward(): 12957 return objs 12958 12959 # Process the attributes: 12960 objs.href = reader.get_attribute('href') 12961 12962 # Discard the start tag: 12963 empty = reader.empty_element() 12964 reader.read() 12965 if empty: 12966 return objs 12967 12968 # Process the inner elements: 12969 while reader.forward(): 12970 objs.append(PowerManagementReader.read_one(reader)) 12971 12972 # Discard the end tag: 12973 reader.read() 12974 12975 return objs 12976 12977 12978class ProductReader(Reader): 12979 12980 def __init__(self): 12981 super(ProductReader, self).__init__() 12982 12983 @staticmethod 12984 def read_one(reader): 12985 # Do nothing if there aren't more tags: 12986 if not reader.forward(): 12987 return None 12988 12989 # Create the object: 12990 obj = types.Product() 12991 12992 # Process the attributes: 12993 obj.href = reader.get_attribute('href') 12994 value = reader.get_attribute('id') 12995 if value is not None: 12996 obj.id = value 12997 12998 # Discard the start tag: 12999 empty = reader.empty_element() 13000 reader.read() 13001 if empty: 13002 return obj 13003 13004 # Process the inner elements: 13005 links = [] 13006 while reader.forward(): 13007 tag = reader.node_name() 13008 if tag == 'comment': 13009 obj.comment = Reader.read_string(reader) 13010 elif tag == 'description': 13011 obj.description = Reader.read_string(reader) 13012 elif tag == 'name': 13013 obj.name = Reader.read_string(reader) 13014 else: 13015 reader.next_element() 13016 for link in links: 13017 ProductReader._process_link(link, obj) 13018 13019 # Discard the end tag: 13020 reader.read() 13021 13022 return obj 13023 13024 @staticmethod 13025 def read_many(reader): 13026 # Do nothing if there aren't more tags: 13027 objs = List() 13028 if not reader.forward(): 13029 return objs 13030 13031 # Process the attributes: 13032 objs.href = reader.get_attribute('href') 13033 13034 # Discard the start tag: 13035 empty = reader.empty_element() 13036 reader.read() 13037 if empty: 13038 return objs 13039 13040 # Process the inner elements: 13041 while reader.forward(): 13042 objs.append(ProductReader.read_one(reader)) 13043 13044 # Discard the end tag: 13045 reader.read() 13046 13047 return objs 13048 13049 13050class ProductInfoReader(Reader): 13051 13052 def __init__(self): 13053 super(ProductInfoReader, self).__init__() 13054 13055 @staticmethod 13056 def read_one(reader): 13057 # Do nothing if there aren't more tags: 13058 if not reader.forward(): 13059 return None 13060 13061 # Create the object: 13062 obj = types.ProductInfo() 13063 13064 # Process the attributes: 13065 obj.href = reader.get_attribute('href') 13066 13067 # Discard the start tag: 13068 empty = reader.empty_element() 13069 reader.read() 13070 if empty: 13071 return obj 13072 13073 # Process the inner elements: 13074 links = [] 13075 while reader.forward(): 13076 tag = reader.node_name() 13077 if tag == 'instance_id': 13078 obj.instance_id = Reader.read_string(reader) 13079 elif tag == 'name': 13080 obj.name = Reader.read_string(reader) 13081 elif tag == 'vendor': 13082 obj.vendor = Reader.read_string(reader) 13083 elif tag == 'version': 13084 obj.version = VersionReader.read_one(reader) 13085 else: 13086 reader.next_element() 13087 for link in links: 13088 ProductInfoReader._process_link(link, obj) 13089 13090 # Discard the end tag: 13091 reader.read() 13092 13093 return obj 13094 13095 @staticmethod 13096 def read_many(reader): 13097 # Do nothing if there aren't more tags: 13098 objs = List() 13099 if not reader.forward(): 13100 return objs 13101 13102 # Process the attributes: 13103 objs.href = reader.get_attribute('href') 13104 13105 # Discard the start tag: 13106 empty = reader.empty_element() 13107 reader.read() 13108 if empty: 13109 return objs 13110 13111 # Process the inner elements: 13112 while reader.forward(): 13113 objs.append(ProductInfoReader.read_one(reader)) 13114 13115 # Discard the end tag: 13116 reader.read() 13117 13118 return objs 13119 13120 13121class ProfileDetailReader(Reader): 13122 13123 def __init__(self): 13124 super(ProfileDetailReader, self).__init__() 13125 13126 @staticmethod 13127 def read_one(reader): 13128 # Do nothing if there aren't more tags: 13129 if not reader.forward(): 13130 return None 13131 13132 # Create the object: 13133 obj = types.ProfileDetail() 13134 13135 # Process the attributes: 13136 obj.href = reader.get_attribute('href') 13137 13138 # Discard the start tag: 13139 empty = reader.empty_element() 13140 reader.read() 13141 if empty: 13142 return obj 13143 13144 # Process the inner elements: 13145 links = [] 13146 while reader.forward(): 13147 tag = reader.node_name() 13148 if tag == 'block_statistics': 13149 obj.block_statistics = BlockStatisticReader.read_many(reader) 13150 elif tag == 'duration': 13151 obj.duration = Reader.read_integer(reader) 13152 elif tag == 'fop_statistics': 13153 obj.fop_statistics = FopStatisticReader.read_many(reader) 13154 elif tag == 'profile_type': 13155 obj.profile_type = Reader.read_string(reader) 13156 elif tag == 'statistics': 13157 obj.statistics = StatisticReader.read_many(reader) 13158 else: 13159 reader.next_element() 13160 for link in links: 13161 ProfileDetailReader._process_link(link, obj) 13162 13163 # Discard the end tag: 13164 reader.read() 13165 13166 return obj 13167 13168 @staticmethod 13169 def read_many(reader): 13170 # Do nothing if there aren't more tags: 13171 objs = List() 13172 if not reader.forward(): 13173 return objs 13174 13175 # Process the attributes: 13176 objs.href = reader.get_attribute('href') 13177 13178 # Discard the start tag: 13179 empty = reader.empty_element() 13180 reader.read() 13181 if empty: 13182 return objs 13183 13184 # Process the inner elements: 13185 while reader.forward(): 13186 objs.append(ProfileDetailReader.read_one(reader)) 13187 13188 # Discard the end tag: 13189 reader.read() 13190 13191 return objs 13192 13193 13194class PropertyReader(Reader): 13195 13196 def __init__(self): 13197 super(PropertyReader, self).__init__() 13198 13199 @staticmethod 13200 def read_one(reader): 13201 # Do nothing if there aren't more tags: 13202 if not reader.forward(): 13203 return None 13204 13205 # Create the object: 13206 obj = types.Property() 13207 13208 # Process the attributes: 13209 obj.href = reader.get_attribute('href') 13210 13211 # Discard the start tag: 13212 empty = reader.empty_element() 13213 reader.read() 13214 if empty: 13215 return obj 13216 13217 # Process the inner elements: 13218 links = [] 13219 while reader.forward(): 13220 tag = reader.node_name() 13221 if tag == 'name': 13222 obj.name = Reader.read_string(reader) 13223 elif tag == 'value': 13224 obj.value = Reader.read_string(reader) 13225 else: 13226 reader.next_element() 13227 for link in links: 13228 PropertyReader._process_link(link, obj) 13229 13230 # Discard the end tag: 13231 reader.read() 13232 13233 return obj 13234 13235 @staticmethod 13236 def read_many(reader): 13237 # Do nothing if there aren't more tags: 13238 objs = List() 13239 if not reader.forward(): 13240 return objs 13241 13242 # Process the attributes: 13243 objs.href = reader.get_attribute('href') 13244 13245 # Discard the start tag: 13246 empty = reader.empty_element() 13247 reader.read() 13248 if empty: 13249 return objs 13250 13251 # Process the inner elements: 13252 while reader.forward(): 13253 objs.append(PropertyReader.read_one(reader)) 13254 13255 # Discard the end tag: 13256 reader.read() 13257 13258 return objs 13259 13260 13261class ProxyTicketReader(Reader): 13262 13263 def __init__(self): 13264 super(ProxyTicketReader, self).__init__() 13265 13266 @staticmethod 13267 def read_one(reader): 13268 # Do nothing if there aren't more tags: 13269 if not reader.forward(): 13270 return None 13271 13272 # Create the object: 13273 obj = types.ProxyTicket() 13274 13275 # Process the attributes: 13276 obj.href = reader.get_attribute('href') 13277 13278 # Discard the start tag: 13279 empty = reader.empty_element() 13280 reader.read() 13281 if empty: 13282 return obj 13283 13284 # Process the inner elements: 13285 links = [] 13286 while reader.forward(): 13287 tag = reader.node_name() 13288 if tag == 'value': 13289 obj.value = Reader.read_string(reader) 13290 else: 13291 reader.next_element() 13292 for link in links: 13293 ProxyTicketReader._process_link(link, obj) 13294 13295 # Discard the end tag: 13296 reader.read() 13297 13298 return obj 13299 13300 @staticmethod 13301 def read_many(reader): 13302 # Do nothing if there aren't more tags: 13303 objs = List() 13304 if not reader.forward(): 13305 return objs 13306 13307 # Process the attributes: 13308 objs.href = reader.get_attribute('href') 13309 13310 # Discard the start tag: 13311 empty = reader.empty_element() 13312 reader.read() 13313 if empty: 13314 return objs 13315 13316 # Process the inner elements: 13317 while reader.forward(): 13318 objs.append(ProxyTicketReader.read_one(reader)) 13319 13320 # Discard the end tag: 13321 reader.read() 13322 13323 return objs 13324 13325 13326class QosReader(Reader): 13327 13328 def __init__(self): 13329 super(QosReader, self).__init__() 13330 13331 @staticmethod 13332 def read_one(reader): 13333 # Do nothing if there aren't more tags: 13334 if not reader.forward(): 13335 return None 13336 13337 # Create the object: 13338 obj = types.Qos() 13339 13340 # Process the attributes: 13341 obj.href = reader.get_attribute('href') 13342 value = reader.get_attribute('id') 13343 if value is not None: 13344 obj.id = value 13345 13346 # Discard the start tag: 13347 empty = reader.empty_element() 13348 reader.read() 13349 if empty: 13350 return obj 13351 13352 # Process the inner elements: 13353 links = [] 13354 while reader.forward(): 13355 tag = reader.node_name() 13356 if tag == 'comment': 13357 obj.comment = Reader.read_string(reader) 13358 elif tag == 'cpu_limit': 13359 obj.cpu_limit = Reader.read_integer(reader) 13360 elif tag == 'data_center': 13361 obj.data_center = DataCenterReader.read_one(reader) 13362 elif tag == 'description': 13363 obj.description = Reader.read_string(reader) 13364 elif tag == 'inbound_average': 13365 obj.inbound_average = Reader.read_integer(reader) 13366 elif tag == 'inbound_burst': 13367 obj.inbound_burst = Reader.read_integer(reader) 13368 elif tag == 'inbound_peak': 13369 obj.inbound_peak = Reader.read_integer(reader) 13370 elif tag == 'max_iops': 13371 obj.max_iops = Reader.read_integer(reader) 13372 elif tag == 'max_read_iops': 13373 obj.max_read_iops = Reader.read_integer(reader) 13374 elif tag == 'max_read_throughput': 13375 obj.max_read_throughput = Reader.read_integer(reader) 13376 elif tag == 'max_throughput': 13377 obj.max_throughput = Reader.read_integer(reader) 13378 elif tag == 'max_write_iops': 13379 obj.max_write_iops = Reader.read_integer(reader) 13380 elif tag == 'max_write_throughput': 13381 obj.max_write_throughput = Reader.read_integer(reader) 13382 elif tag == 'name': 13383 obj.name = Reader.read_string(reader) 13384 elif tag == 'outbound_average': 13385 obj.outbound_average = Reader.read_integer(reader) 13386 elif tag == 'outbound_average_linkshare': 13387 obj.outbound_average_linkshare = Reader.read_integer(reader) 13388 elif tag == 'outbound_average_realtime': 13389 obj.outbound_average_realtime = Reader.read_integer(reader) 13390 elif tag == 'outbound_average_upperlimit': 13391 obj.outbound_average_upperlimit = Reader.read_integer(reader) 13392 elif tag == 'outbound_burst': 13393 obj.outbound_burst = Reader.read_integer(reader) 13394 elif tag == 'outbound_peak': 13395 obj.outbound_peak = Reader.read_integer(reader) 13396 elif tag == 'type': 13397 obj.type = Reader.read_enum(types.QosType, reader) 13398 else: 13399 reader.next_element() 13400 for link in links: 13401 QosReader._process_link(link, obj) 13402 13403 # Discard the end tag: 13404 reader.read() 13405 13406 return obj 13407 13408 @staticmethod 13409 def read_many(reader): 13410 # Do nothing if there aren't more tags: 13411 objs = List() 13412 if not reader.forward(): 13413 return objs 13414 13415 # Process the attributes: 13416 objs.href = reader.get_attribute('href') 13417 13418 # Discard the start tag: 13419 empty = reader.empty_element() 13420 reader.read() 13421 if empty: 13422 return objs 13423 13424 # Process the inner elements: 13425 while reader.forward(): 13426 objs.append(QosReader.read_one(reader)) 13427 13428 # Discard the end tag: 13429 reader.read() 13430 13431 return objs 13432 13433 13434class QuotaReader(Reader): 13435 13436 def __init__(self): 13437 super(QuotaReader, self).__init__() 13438 13439 @staticmethod 13440 def read_one(reader): 13441 # Do nothing if there aren't more tags: 13442 if not reader.forward(): 13443 return None 13444 13445 # Create the object: 13446 obj = types.Quota() 13447 13448 # Process the attributes: 13449 obj.href = reader.get_attribute('href') 13450 value = reader.get_attribute('id') 13451 if value is not None: 13452 obj.id = value 13453 13454 # Discard the start tag: 13455 empty = reader.empty_element() 13456 reader.read() 13457 if empty: 13458 return obj 13459 13460 # Process the inner elements: 13461 links = [] 13462 while reader.forward(): 13463 tag = reader.node_name() 13464 if tag == 'cluster_hard_limit_pct': 13465 obj.cluster_hard_limit_pct = Reader.read_integer(reader) 13466 elif tag == 'cluster_soft_limit_pct': 13467 obj.cluster_soft_limit_pct = Reader.read_integer(reader) 13468 elif tag == 'comment': 13469 obj.comment = Reader.read_string(reader) 13470 elif tag == 'data_center': 13471 obj.data_center = DataCenterReader.read_one(reader) 13472 elif tag == 'description': 13473 obj.description = Reader.read_string(reader) 13474 elif tag == 'disks': 13475 obj.disks = DiskReader.read_many(reader) 13476 elif tag == 'name': 13477 obj.name = Reader.read_string(reader) 13478 elif tag == 'permissions': 13479 obj.permissions = PermissionReader.read_many(reader) 13480 elif tag == 'quota_cluster_limits': 13481 obj.quota_cluster_limits = QuotaClusterLimitReader.read_many(reader) 13482 elif tag == 'quota_storage_limits': 13483 obj.quota_storage_limits = QuotaStorageLimitReader.read_many(reader) 13484 elif tag == 'storage_hard_limit_pct': 13485 obj.storage_hard_limit_pct = Reader.read_integer(reader) 13486 elif tag == 'storage_soft_limit_pct': 13487 obj.storage_soft_limit_pct = Reader.read_integer(reader) 13488 elif tag == 'users': 13489 obj.users = UserReader.read_many(reader) 13490 elif tag == 'vms': 13491 obj.vms = VmReader.read_many(reader) 13492 elif tag == 'link': 13493 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 13494 reader.next_element() 13495 else: 13496 reader.next_element() 13497 for link in links: 13498 QuotaReader._process_link(link, obj) 13499 13500 # Discard the end tag: 13501 reader.read() 13502 13503 return obj 13504 13505 @staticmethod 13506 def read_many(reader): 13507 # Do nothing if there aren't more tags: 13508 objs = List() 13509 if not reader.forward(): 13510 return objs 13511 13512 # Process the attributes: 13513 objs.href = reader.get_attribute('href') 13514 13515 # Discard the start tag: 13516 empty = reader.empty_element() 13517 reader.read() 13518 if empty: 13519 return objs 13520 13521 # Process the inner elements: 13522 while reader.forward(): 13523 objs.append(QuotaReader.read_one(reader)) 13524 13525 # Discard the end tag: 13526 reader.read() 13527 13528 return objs 13529 13530 @staticmethod 13531 def _process_link(link, obj): 13532 # Process the attributes: 13533 rel = link[0] 13534 href = link[1] 13535 if href and rel: 13536 if rel == "permissions": 13537 if obj.permissions is not None: 13538 obj.permissions.href = href 13539 else: 13540 obj.permissions = List(href) 13541 elif rel == "quotaclusterlimits": 13542 if obj.quota_cluster_limits is not None: 13543 obj.quota_cluster_limits.href = href 13544 else: 13545 obj.quota_cluster_limits = List(href) 13546 elif rel == "quotastoragelimits": 13547 if obj.quota_storage_limits is not None: 13548 obj.quota_storage_limits.href = href 13549 else: 13550 obj.quota_storage_limits = List(href) 13551 13552 13553class QuotaClusterLimitReader(Reader): 13554 13555 def __init__(self): 13556 super(QuotaClusterLimitReader, self).__init__() 13557 13558 @staticmethod 13559 def read_one(reader): 13560 # Do nothing if there aren't more tags: 13561 if not reader.forward(): 13562 return None 13563 13564 # Create the object: 13565 obj = types.QuotaClusterLimit() 13566 13567 # Process the attributes: 13568 obj.href = reader.get_attribute('href') 13569 value = reader.get_attribute('id') 13570 if value is not None: 13571 obj.id = value 13572 13573 # Discard the start tag: 13574 empty = reader.empty_element() 13575 reader.read() 13576 if empty: 13577 return obj 13578 13579 # Process the inner elements: 13580 links = [] 13581 while reader.forward(): 13582 tag = reader.node_name() 13583 if tag == 'cluster': 13584 obj.cluster = ClusterReader.read_one(reader) 13585 elif tag == 'comment': 13586 obj.comment = Reader.read_string(reader) 13587 elif tag == 'description': 13588 obj.description = Reader.read_string(reader) 13589 elif tag == 'memory_limit': 13590 obj.memory_limit = Reader.read_decimal(reader) 13591 elif tag == 'memory_usage': 13592 obj.memory_usage = Reader.read_decimal(reader) 13593 elif tag == 'name': 13594 obj.name = Reader.read_string(reader) 13595 elif tag == 'quota': 13596 obj.quota = QuotaReader.read_one(reader) 13597 elif tag == 'vcpu_limit': 13598 obj.vcpu_limit = Reader.read_integer(reader) 13599 elif tag == 'vcpu_usage': 13600 obj.vcpu_usage = Reader.read_integer(reader) 13601 else: 13602 reader.next_element() 13603 for link in links: 13604 QuotaClusterLimitReader._process_link(link, obj) 13605 13606 # Discard the end tag: 13607 reader.read() 13608 13609 return obj 13610 13611 @staticmethod 13612 def read_many(reader): 13613 # Do nothing if there aren't more tags: 13614 objs = List() 13615 if not reader.forward(): 13616 return objs 13617 13618 # Process the attributes: 13619 objs.href = reader.get_attribute('href') 13620 13621 # Discard the start tag: 13622 empty = reader.empty_element() 13623 reader.read() 13624 if empty: 13625 return objs 13626 13627 # Process the inner elements: 13628 while reader.forward(): 13629 objs.append(QuotaClusterLimitReader.read_one(reader)) 13630 13631 # Discard the end tag: 13632 reader.read() 13633 13634 return objs 13635 13636 13637class QuotaStorageLimitReader(Reader): 13638 13639 def __init__(self): 13640 super(QuotaStorageLimitReader, self).__init__() 13641 13642 @staticmethod 13643 def read_one(reader): 13644 # Do nothing if there aren't more tags: 13645 if not reader.forward(): 13646 return None 13647 13648 # Create the object: 13649 obj = types.QuotaStorageLimit() 13650 13651 # Process the attributes: 13652 obj.href = reader.get_attribute('href') 13653 value = reader.get_attribute('id') 13654 if value is not None: 13655 obj.id = value 13656 13657 # Discard the start tag: 13658 empty = reader.empty_element() 13659 reader.read() 13660 if empty: 13661 return obj 13662 13663 # Process the inner elements: 13664 links = [] 13665 while reader.forward(): 13666 tag = reader.node_name() 13667 if tag == 'comment': 13668 obj.comment = Reader.read_string(reader) 13669 elif tag == 'description': 13670 obj.description = Reader.read_string(reader) 13671 elif tag == 'limit': 13672 obj.limit = Reader.read_integer(reader) 13673 elif tag == 'name': 13674 obj.name = Reader.read_string(reader) 13675 elif tag == 'quota': 13676 obj.quota = QuotaReader.read_one(reader) 13677 elif tag == 'storage_domain': 13678 obj.storage_domain = StorageDomainReader.read_one(reader) 13679 elif tag == 'usage': 13680 obj.usage = Reader.read_decimal(reader) 13681 else: 13682 reader.next_element() 13683 for link in links: 13684 QuotaStorageLimitReader._process_link(link, obj) 13685 13686 # Discard the end tag: 13687 reader.read() 13688 13689 return obj 13690 13691 @staticmethod 13692 def read_many(reader): 13693 # Do nothing if there aren't more tags: 13694 objs = List() 13695 if not reader.forward(): 13696 return objs 13697 13698 # Process the attributes: 13699 objs.href = reader.get_attribute('href') 13700 13701 # Discard the start tag: 13702 empty = reader.empty_element() 13703 reader.read() 13704 if empty: 13705 return objs 13706 13707 # Process the inner elements: 13708 while reader.forward(): 13709 objs.append(QuotaStorageLimitReader.read_one(reader)) 13710 13711 # Discard the end tag: 13712 reader.read() 13713 13714 return objs 13715 13716 13717class RangeReader(Reader): 13718 13719 def __init__(self): 13720 super(RangeReader, self).__init__() 13721 13722 @staticmethod 13723 def read_one(reader): 13724 # Do nothing if there aren't more tags: 13725 if not reader.forward(): 13726 return None 13727 13728 # Create the object: 13729 obj = types.Range() 13730 13731 # Process the attributes: 13732 obj.href = reader.get_attribute('href') 13733 13734 # Discard the start tag: 13735 empty = reader.empty_element() 13736 reader.read() 13737 if empty: 13738 return obj 13739 13740 # Process the inner elements: 13741 links = [] 13742 while reader.forward(): 13743 tag = reader.node_name() 13744 if tag == 'from': 13745 obj.from_ = Reader.read_string(reader) 13746 elif tag == 'to': 13747 obj.to = Reader.read_string(reader) 13748 else: 13749 reader.next_element() 13750 for link in links: 13751 RangeReader._process_link(link, obj) 13752 13753 # Discard the end tag: 13754 reader.read() 13755 13756 return obj 13757 13758 @staticmethod 13759 def read_many(reader): 13760 # Do nothing if there aren't more tags: 13761 objs = List() 13762 if not reader.forward(): 13763 return objs 13764 13765 # Process the attributes: 13766 objs.href = reader.get_attribute('href') 13767 13768 # Discard the start tag: 13769 empty = reader.empty_element() 13770 reader.read() 13771 if empty: 13772 return objs 13773 13774 # Process the inner elements: 13775 while reader.forward(): 13776 objs.append(RangeReader.read_one(reader)) 13777 13778 # Discard the end tag: 13779 reader.read() 13780 13781 return objs 13782 13783 13784class RateReader(Reader): 13785 13786 def __init__(self): 13787 super(RateReader, self).__init__() 13788 13789 @staticmethod 13790 def read_one(reader): 13791 # Do nothing if there aren't more tags: 13792 if not reader.forward(): 13793 return None 13794 13795 # Create the object: 13796 obj = types.Rate() 13797 13798 # Process the attributes: 13799 obj.href = reader.get_attribute('href') 13800 13801 # Discard the start tag: 13802 empty = reader.empty_element() 13803 reader.read() 13804 if empty: 13805 return obj 13806 13807 # Process the inner elements: 13808 links = [] 13809 while reader.forward(): 13810 tag = reader.node_name() 13811 if tag == 'bytes': 13812 obj.bytes = Reader.read_integer(reader) 13813 elif tag == 'period': 13814 obj.period = Reader.read_integer(reader) 13815 else: 13816 reader.next_element() 13817 for link in links: 13818 RateReader._process_link(link, obj) 13819 13820 # Discard the end tag: 13821 reader.read() 13822 13823 return obj 13824 13825 @staticmethod 13826 def read_many(reader): 13827 # Do nothing if there aren't more tags: 13828 objs = List() 13829 if not reader.forward(): 13830 return objs 13831 13832 # Process the attributes: 13833 objs.href = reader.get_attribute('href') 13834 13835 # Discard the start tag: 13836 empty = reader.empty_element() 13837 reader.read() 13838 if empty: 13839 return objs 13840 13841 # Process the inner elements: 13842 while reader.forward(): 13843 objs.append(RateReader.read_one(reader)) 13844 13845 # Discard the end tag: 13846 reader.read() 13847 13848 return objs 13849 13850 13851class RegistrationAffinityGroupMappingReader(Reader): 13852 13853 def __init__(self): 13854 super(RegistrationAffinityGroupMappingReader, self).__init__() 13855 13856 @staticmethod 13857 def read_one(reader): 13858 # Do nothing if there aren't more tags: 13859 if not reader.forward(): 13860 return None 13861 13862 # Create the object: 13863 obj = types.RegistrationAffinityGroupMapping() 13864 13865 # Process the attributes: 13866 obj.href = reader.get_attribute('href') 13867 13868 # Discard the start tag: 13869 empty = reader.empty_element() 13870 reader.read() 13871 if empty: 13872 return obj 13873 13874 # Process the inner elements: 13875 links = [] 13876 while reader.forward(): 13877 tag = reader.node_name() 13878 if tag == 'from': 13879 obj.from_ = AffinityGroupReader.read_one(reader) 13880 elif tag == 'to': 13881 obj.to = AffinityGroupReader.read_one(reader) 13882 else: 13883 reader.next_element() 13884 for link in links: 13885 RegistrationAffinityGroupMappingReader._process_link(link, obj) 13886 13887 # Discard the end tag: 13888 reader.read() 13889 13890 return obj 13891 13892 @staticmethod 13893 def read_many(reader): 13894 # Do nothing if there aren't more tags: 13895 objs = List() 13896 if not reader.forward(): 13897 return objs 13898 13899 # Process the attributes: 13900 objs.href = reader.get_attribute('href') 13901 13902 # Discard the start tag: 13903 empty = reader.empty_element() 13904 reader.read() 13905 if empty: 13906 return objs 13907 13908 # Process the inner elements: 13909 while reader.forward(): 13910 objs.append(RegistrationAffinityGroupMappingReader.read_one(reader)) 13911 13912 # Discard the end tag: 13913 reader.read() 13914 13915 return objs 13916 13917 13918class RegistrationAffinityLabelMappingReader(Reader): 13919 13920 def __init__(self): 13921 super(RegistrationAffinityLabelMappingReader, self).__init__() 13922 13923 @staticmethod 13924 def read_one(reader): 13925 # Do nothing if there aren't more tags: 13926 if not reader.forward(): 13927 return None 13928 13929 # Create the object: 13930 obj = types.RegistrationAffinityLabelMapping() 13931 13932 # Process the attributes: 13933 obj.href = reader.get_attribute('href') 13934 13935 # Discard the start tag: 13936 empty = reader.empty_element() 13937 reader.read() 13938 if empty: 13939 return obj 13940 13941 # Process the inner elements: 13942 links = [] 13943 while reader.forward(): 13944 tag = reader.node_name() 13945 if tag == 'from': 13946 obj.from_ = AffinityLabelReader.read_one(reader) 13947 elif tag == 'to': 13948 obj.to = AffinityLabelReader.read_one(reader) 13949 else: 13950 reader.next_element() 13951 for link in links: 13952 RegistrationAffinityLabelMappingReader._process_link(link, obj) 13953 13954 # Discard the end tag: 13955 reader.read() 13956 13957 return obj 13958 13959 @staticmethod 13960 def read_many(reader): 13961 # Do nothing if there aren't more tags: 13962 objs = List() 13963 if not reader.forward(): 13964 return objs 13965 13966 # Process the attributes: 13967 objs.href = reader.get_attribute('href') 13968 13969 # Discard the start tag: 13970 empty = reader.empty_element() 13971 reader.read() 13972 if empty: 13973 return objs 13974 13975 # Process the inner elements: 13976 while reader.forward(): 13977 objs.append(RegistrationAffinityLabelMappingReader.read_one(reader)) 13978 13979 # Discard the end tag: 13980 reader.read() 13981 13982 return objs 13983 13984 13985class RegistrationClusterMappingReader(Reader): 13986 13987 def __init__(self): 13988 super(RegistrationClusterMappingReader, self).__init__() 13989 13990 @staticmethod 13991 def read_one(reader): 13992 # Do nothing if there aren't more tags: 13993 if not reader.forward(): 13994 return None 13995 13996 # Create the object: 13997 obj = types.RegistrationClusterMapping() 13998 13999 # Process the attributes: 14000 obj.href = reader.get_attribute('href') 14001 14002 # Discard the start tag: 14003 empty = reader.empty_element() 14004 reader.read() 14005 if empty: 14006 return obj 14007 14008 # Process the inner elements: 14009 links = [] 14010 while reader.forward(): 14011 tag = reader.node_name() 14012 if tag == 'from': 14013 obj.from_ = ClusterReader.read_one(reader) 14014 elif tag == 'to': 14015 obj.to = ClusterReader.read_one(reader) 14016 else: 14017 reader.next_element() 14018 for link in links: 14019 RegistrationClusterMappingReader._process_link(link, obj) 14020 14021 # Discard the end tag: 14022 reader.read() 14023 14024 return obj 14025 14026 @staticmethod 14027 def read_many(reader): 14028 # Do nothing if there aren't more tags: 14029 objs = List() 14030 if not reader.forward(): 14031 return objs 14032 14033 # Process the attributes: 14034 objs.href = reader.get_attribute('href') 14035 14036 # Discard the start tag: 14037 empty = reader.empty_element() 14038 reader.read() 14039 if empty: 14040 return objs 14041 14042 # Process the inner elements: 14043 while reader.forward(): 14044 objs.append(RegistrationClusterMappingReader.read_one(reader)) 14045 14046 # Discard the end tag: 14047 reader.read() 14048 14049 return objs 14050 14051 14052class RegistrationConfigurationReader(Reader): 14053 14054 def __init__(self): 14055 super(RegistrationConfigurationReader, self).__init__() 14056 14057 @staticmethod 14058 def read_one(reader): 14059 # Do nothing if there aren't more tags: 14060 if not reader.forward(): 14061 return None 14062 14063 # Create the object: 14064 obj = types.RegistrationConfiguration() 14065 14066 # Process the attributes: 14067 obj.href = reader.get_attribute('href') 14068 14069 # Discard the start tag: 14070 empty = reader.empty_element() 14071 reader.read() 14072 if empty: 14073 return obj 14074 14075 # Process the inner elements: 14076 links = [] 14077 while reader.forward(): 14078 tag = reader.node_name() 14079 if tag == 'affinity_group_mappings': 14080 obj.affinity_group_mappings = RegistrationAffinityGroupMappingReader.read_many(reader) 14081 elif tag == 'affinity_label_mappings': 14082 obj.affinity_label_mappings = RegistrationAffinityLabelMappingReader.read_many(reader) 14083 elif tag == 'cluster_mappings': 14084 obj.cluster_mappings = RegistrationClusterMappingReader.read_many(reader) 14085 elif tag == 'domain_mappings': 14086 obj.domain_mappings = RegistrationDomainMappingReader.read_many(reader) 14087 elif tag == 'lun_mappings': 14088 obj.lun_mappings = RegistrationLunMappingReader.read_many(reader) 14089 elif tag == 'role_mappings': 14090 obj.role_mappings = RegistrationRoleMappingReader.read_many(reader) 14091 elif tag == 'vnic_profile_mappings': 14092 obj.vnic_profile_mappings = RegistrationVnicProfileMappingReader.read_many(reader) 14093 else: 14094 reader.next_element() 14095 for link in links: 14096 RegistrationConfigurationReader._process_link(link, obj) 14097 14098 # Discard the end tag: 14099 reader.read() 14100 14101 return obj 14102 14103 @staticmethod 14104 def read_many(reader): 14105 # Do nothing if there aren't more tags: 14106 objs = List() 14107 if not reader.forward(): 14108 return objs 14109 14110 # Process the attributes: 14111 objs.href = reader.get_attribute('href') 14112 14113 # Discard the start tag: 14114 empty = reader.empty_element() 14115 reader.read() 14116 if empty: 14117 return objs 14118 14119 # Process the inner elements: 14120 while reader.forward(): 14121 objs.append(RegistrationConfigurationReader.read_one(reader)) 14122 14123 # Discard the end tag: 14124 reader.read() 14125 14126 return objs 14127 14128 14129class RegistrationDomainMappingReader(Reader): 14130 14131 def __init__(self): 14132 super(RegistrationDomainMappingReader, self).__init__() 14133 14134 @staticmethod 14135 def read_one(reader): 14136 # Do nothing if there aren't more tags: 14137 if not reader.forward(): 14138 return None 14139 14140 # Create the object: 14141 obj = types.RegistrationDomainMapping() 14142 14143 # Process the attributes: 14144 obj.href = reader.get_attribute('href') 14145 14146 # Discard the start tag: 14147 empty = reader.empty_element() 14148 reader.read() 14149 if empty: 14150 return obj 14151 14152 # Process the inner elements: 14153 links = [] 14154 while reader.forward(): 14155 tag = reader.node_name() 14156 if tag == 'from': 14157 obj.from_ = DomainReader.read_one(reader) 14158 elif tag == 'to': 14159 obj.to = DomainReader.read_one(reader) 14160 else: 14161 reader.next_element() 14162 for link in links: 14163 RegistrationDomainMappingReader._process_link(link, obj) 14164 14165 # Discard the end tag: 14166 reader.read() 14167 14168 return obj 14169 14170 @staticmethod 14171 def read_many(reader): 14172 # Do nothing if there aren't more tags: 14173 objs = List() 14174 if not reader.forward(): 14175 return objs 14176 14177 # Process the attributes: 14178 objs.href = reader.get_attribute('href') 14179 14180 # Discard the start tag: 14181 empty = reader.empty_element() 14182 reader.read() 14183 if empty: 14184 return objs 14185 14186 # Process the inner elements: 14187 while reader.forward(): 14188 objs.append(RegistrationDomainMappingReader.read_one(reader)) 14189 14190 # Discard the end tag: 14191 reader.read() 14192 14193 return objs 14194 14195 14196class RegistrationLunMappingReader(Reader): 14197 14198 def __init__(self): 14199 super(RegistrationLunMappingReader, self).__init__() 14200 14201 @staticmethod 14202 def read_one(reader): 14203 # Do nothing if there aren't more tags: 14204 if not reader.forward(): 14205 return None 14206 14207 # Create the object: 14208 obj = types.RegistrationLunMapping() 14209 14210 # Process the attributes: 14211 obj.href = reader.get_attribute('href') 14212 14213 # Discard the start tag: 14214 empty = reader.empty_element() 14215 reader.read() 14216 if empty: 14217 return obj 14218 14219 # Process the inner elements: 14220 links = [] 14221 while reader.forward(): 14222 tag = reader.node_name() 14223 if tag == 'from': 14224 obj.from_ = DiskReader.read_one(reader) 14225 elif tag == 'to': 14226 obj.to = DiskReader.read_one(reader) 14227 else: 14228 reader.next_element() 14229 for link in links: 14230 RegistrationLunMappingReader._process_link(link, obj) 14231 14232 # Discard the end tag: 14233 reader.read() 14234 14235 return obj 14236 14237 @staticmethod 14238 def read_many(reader): 14239 # Do nothing if there aren't more tags: 14240 objs = List() 14241 if not reader.forward(): 14242 return objs 14243 14244 # Process the attributes: 14245 objs.href = reader.get_attribute('href') 14246 14247 # Discard the start tag: 14248 empty = reader.empty_element() 14249 reader.read() 14250 if empty: 14251 return objs 14252 14253 # Process the inner elements: 14254 while reader.forward(): 14255 objs.append(RegistrationLunMappingReader.read_one(reader)) 14256 14257 # Discard the end tag: 14258 reader.read() 14259 14260 return objs 14261 14262 14263class RegistrationRoleMappingReader(Reader): 14264 14265 def __init__(self): 14266 super(RegistrationRoleMappingReader, self).__init__() 14267 14268 @staticmethod 14269 def read_one(reader): 14270 # Do nothing if there aren't more tags: 14271 if not reader.forward(): 14272 return None 14273 14274 # Create the object: 14275 obj = types.RegistrationRoleMapping() 14276 14277 # Process the attributes: 14278 obj.href = reader.get_attribute('href') 14279 14280 # Discard the start tag: 14281 empty = reader.empty_element() 14282 reader.read() 14283 if empty: 14284 return obj 14285 14286 # Process the inner elements: 14287 links = [] 14288 while reader.forward(): 14289 tag = reader.node_name() 14290 if tag == 'from': 14291 obj.from_ = RoleReader.read_one(reader) 14292 elif tag == 'to': 14293 obj.to = RoleReader.read_one(reader) 14294 else: 14295 reader.next_element() 14296 for link in links: 14297 RegistrationRoleMappingReader._process_link(link, obj) 14298 14299 # Discard the end tag: 14300 reader.read() 14301 14302 return obj 14303 14304 @staticmethod 14305 def read_many(reader): 14306 # Do nothing if there aren't more tags: 14307 objs = List() 14308 if not reader.forward(): 14309 return objs 14310 14311 # Process the attributes: 14312 objs.href = reader.get_attribute('href') 14313 14314 # Discard the start tag: 14315 empty = reader.empty_element() 14316 reader.read() 14317 if empty: 14318 return objs 14319 14320 # Process the inner elements: 14321 while reader.forward(): 14322 objs.append(RegistrationRoleMappingReader.read_one(reader)) 14323 14324 # Discard the end tag: 14325 reader.read() 14326 14327 return objs 14328 14329 14330class RegistrationVnicProfileMappingReader(Reader): 14331 14332 def __init__(self): 14333 super(RegistrationVnicProfileMappingReader, self).__init__() 14334 14335 @staticmethod 14336 def read_one(reader): 14337 # Do nothing if there aren't more tags: 14338 if not reader.forward(): 14339 return None 14340 14341 # Create the object: 14342 obj = types.RegistrationVnicProfileMapping() 14343 14344 # Process the attributes: 14345 obj.href = reader.get_attribute('href') 14346 14347 # Discard the start tag: 14348 empty = reader.empty_element() 14349 reader.read() 14350 if empty: 14351 return obj 14352 14353 # Process the inner elements: 14354 links = [] 14355 while reader.forward(): 14356 tag = reader.node_name() 14357 if tag == 'from': 14358 obj.from_ = VnicProfileReader.read_one(reader) 14359 elif tag == 'to': 14360 obj.to = VnicProfileReader.read_one(reader) 14361 else: 14362 reader.next_element() 14363 for link in links: 14364 RegistrationVnicProfileMappingReader._process_link(link, obj) 14365 14366 # Discard the end tag: 14367 reader.read() 14368 14369 return obj 14370 14371 @staticmethod 14372 def read_many(reader): 14373 # Do nothing if there aren't more tags: 14374 objs = List() 14375 if not reader.forward(): 14376 return objs 14377 14378 # Process the attributes: 14379 objs.href = reader.get_attribute('href') 14380 14381 # Discard the start tag: 14382 empty = reader.empty_element() 14383 reader.read() 14384 if empty: 14385 return objs 14386 14387 # Process the inner elements: 14388 while reader.forward(): 14389 objs.append(RegistrationVnicProfileMappingReader.read_one(reader)) 14390 14391 # Discard the end tag: 14392 reader.read() 14393 14394 return objs 14395 14396 14397class ReportedConfigurationReader(Reader): 14398 14399 def __init__(self): 14400 super(ReportedConfigurationReader, self).__init__() 14401 14402 @staticmethod 14403 def read_one(reader): 14404 # Do nothing if there aren't more tags: 14405 if not reader.forward(): 14406 return None 14407 14408 # Create the object: 14409 obj = types.ReportedConfiguration() 14410 14411 # Process the attributes: 14412 obj.href = reader.get_attribute('href') 14413 14414 # Discard the start tag: 14415 empty = reader.empty_element() 14416 reader.read() 14417 if empty: 14418 return obj 14419 14420 # Process the inner elements: 14421 links = [] 14422 while reader.forward(): 14423 tag = reader.node_name() 14424 if tag == 'actual_value': 14425 obj.actual_value = Reader.read_string(reader) 14426 elif tag == 'expected_value': 14427 obj.expected_value = Reader.read_string(reader) 14428 elif tag == 'in_sync': 14429 obj.in_sync = Reader.read_boolean(reader) 14430 elif tag == 'name': 14431 obj.name = Reader.read_string(reader) 14432 else: 14433 reader.next_element() 14434 for link in links: 14435 ReportedConfigurationReader._process_link(link, obj) 14436 14437 # Discard the end tag: 14438 reader.read() 14439 14440 return obj 14441 14442 @staticmethod 14443 def read_many(reader): 14444 # Do nothing if there aren't more tags: 14445 objs = List() 14446 if not reader.forward(): 14447 return objs 14448 14449 # Process the attributes: 14450 objs.href = reader.get_attribute('href') 14451 14452 # Discard the start tag: 14453 empty = reader.empty_element() 14454 reader.read() 14455 if empty: 14456 return objs 14457 14458 # Process the inner elements: 14459 while reader.forward(): 14460 objs.append(ReportedConfigurationReader.read_one(reader)) 14461 14462 # Discard the end tag: 14463 reader.read() 14464 14465 return objs 14466 14467 14468class ReportedDeviceReader(Reader): 14469 14470 def __init__(self): 14471 super(ReportedDeviceReader, self).__init__() 14472 14473 @staticmethod 14474 def read_one(reader): 14475 # Do nothing if there aren't more tags: 14476 if not reader.forward(): 14477 return None 14478 14479 # Create the object: 14480 obj = types.ReportedDevice() 14481 14482 # Process the attributes: 14483 obj.href = reader.get_attribute('href') 14484 value = reader.get_attribute('id') 14485 if value is not None: 14486 obj.id = value 14487 14488 # Discard the start tag: 14489 empty = reader.empty_element() 14490 reader.read() 14491 if empty: 14492 return obj 14493 14494 # Process the inner elements: 14495 links = [] 14496 while reader.forward(): 14497 tag = reader.node_name() 14498 if tag == 'comment': 14499 obj.comment = Reader.read_string(reader) 14500 elif tag == 'description': 14501 obj.description = Reader.read_string(reader) 14502 elif tag == 'ips': 14503 obj.ips = IpReader.read_many(reader) 14504 elif tag == 'mac': 14505 obj.mac = MacReader.read_one(reader) 14506 elif tag == 'name': 14507 obj.name = Reader.read_string(reader) 14508 elif tag == 'type': 14509 obj.type = Reader.read_enum(types.ReportedDeviceType, reader) 14510 elif tag == 'vm': 14511 obj.vm = VmReader.read_one(reader) 14512 else: 14513 reader.next_element() 14514 for link in links: 14515 ReportedDeviceReader._process_link(link, obj) 14516 14517 # Discard the end tag: 14518 reader.read() 14519 14520 return obj 14521 14522 @staticmethod 14523 def read_many(reader): 14524 # Do nothing if there aren't more tags: 14525 objs = List() 14526 if not reader.forward(): 14527 return objs 14528 14529 # Process the attributes: 14530 objs.href = reader.get_attribute('href') 14531 14532 # Discard the start tag: 14533 empty = reader.empty_element() 14534 reader.read() 14535 if empty: 14536 return objs 14537 14538 # Process the inner elements: 14539 while reader.forward(): 14540 objs.append(ReportedDeviceReader.read_one(reader)) 14541 14542 # Discard the end tag: 14543 reader.read() 14544 14545 return objs 14546 14547 14548class RngDeviceReader(Reader): 14549 14550 def __init__(self): 14551 super(RngDeviceReader, self).__init__() 14552 14553 @staticmethod 14554 def read_one(reader): 14555 # Do nothing if there aren't more tags: 14556 if not reader.forward(): 14557 return None 14558 14559 # Create the object: 14560 obj = types.RngDevice() 14561 14562 # Process the attributes: 14563 obj.href = reader.get_attribute('href') 14564 14565 # Discard the start tag: 14566 empty = reader.empty_element() 14567 reader.read() 14568 if empty: 14569 return obj 14570 14571 # Process the inner elements: 14572 links = [] 14573 while reader.forward(): 14574 tag = reader.node_name() 14575 if tag == 'rate': 14576 obj.rate = RateReader.read_one(reader) 14577 elif tag == 'source': 14578 obj.source = Reader.read_enum(types.RngSource, reader) 14579 else: 14580 reader.next_element() 14581 for link in links: 14582 RngDeviceReader._process_link(link, obj) 14583 14584 # Discard the end tag: 14585 reader.read() 14586 14587 return obj 14588 14589 @staticmethod 14590 def read_many(reader): 14591 # Do nothing if there aren't more tags: 14592 objs = List() 14593 if not reader.forward(): 14594 return objs 14595 14596 # Process the attributes: 14597 objs.href = reader.get_attribute('href') 14598 14599 # Discard the start tag: 14600 empty = reader.empty_element() 14601 reader.read() 14602 if empty: 14603 return objs 14604 14605 # Process the inner elements: 14606 while reader.forward(): 14607 objs.append(RngDeviceReader.read_one(reader)) 14608 14609 # Discard the end tag: 14610 reader.read() 14611 14612 return objs 14613 14614 14615class RoleReader(Reader): 14616 14617 def __init__(self): 14618 super(RoleReader, self).__init__() 14619 14620 @staticmethod 14621 def read_one(reader): 14622 # Do nothing if there aren't more tags: 14623 if not reader.forward(): 14624 return None 14625 14626 # Create the object: 14627 obj = types.Role() 14628 14629 # Process the attributes: 14630 obj.href = reader.get_attribute('href') 14631 value = reader.get_attribute('id') 14632 if value is not None: 14633 obj.id = value 14634 14635 # Discard the start tag: 14636 empty = reader.empty_element() 14637 reader.read() 14638 if empty: 14639 return obj 14640 14641 # Process the inner elements: 14642 links = [] 14643 while reader.forward(): 14644 tag = reader.node_name() 14645 if tag == 'administrative': 14646 obj.administrative = Reader.read_boolean(reader) 14647 elif tag == 'comment': 14648 obj.comment = Reader.read_string(reader) 14649 elif tag == 'description': 14650 obj.description = Reader.read_string(reader) 14651 elif tag == 'mutable': 14652 obj.mutable = Reader.read_boolean(reader) 14653 elif tag == 'name': 14654 obj.name = Reader.read_string(reader) 14655 elif tag == 'permits': 14656 obj.permits = PermitReader.read_many(reader) 14657 elif tag == 'user': 14658 obj.user = UserReader.read_one(reader) 14659 elif tag == 'link': 14660 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14661 reader.next_element() 14662 else: 14663 reader.next_element() 14664 for link in links: 14665 RoleReader._process_link(link, obj) 14666 14667 # Discard the end tag: 14668 reader.read() 14669 14670 return obj 14671 14672 @staticmethod 14673 def read_many(reader): 14674 # Do nothing if there aren't more tags: 14675 objs = List() 14676 if not reader.forward(): 14677 return objs 14678 14679 # Process the attributes: 14680 objs.href = reader.get_attribute('href') 14681 14682 # Discard the start tag: 14683 empty = reader.empty_element() 14684 reader.read() 14685 if empty: 14686 return objs 14687 14688 # Process the inner elements: 14689 while reader.forward(): 14690 objs.append(RoleReader.read_one(reader)) 14691 14692 # Discard the end tag: 14693 reader.read() 14694 14695 return objs 14696 14697 @staticmethod 14698 def _process_link(link, obj): 14699 # Process the attributes: 14700 rel = link[0] 14701 href = link[1] 14702 if href and rel: 14703 if rel == "permits": 14704 if obj.permits is not None: 14705 obj.permits.href = href 14706 else: 14707 obj.permits = List(href) 14708 14709 14710class SchedulingPolicyReader(Reader): 14711 14712 def __init__(self): 14713 super(SchedulingPolicyReader, self).__init__() 14714 14715 @staticmethod 14716 def read_one(reader): 14717 # Do nothing if there aren't more tags: 14718 if not reader.forward(): 14719 return None 14720 14721 # Create the object: 14722 obj = types.SchedulingPolicy() 14723 14724 # Process the attributes: 14725 obj.href = reader.get_attribute('href') 14726 value = reader.get_attribute('id') 14727 if value is not None: 14728 obj.id = value 14729 14730 # Discard the start tag: 14731 empty = reader.empty_element() 14732 reader.read() 14733 if empty: 14734 return obj 14735 14736 # Process the inner elements: 14737 links = [] 14738 while reader.forward(): 14739 tag = reader.node_name() 14740 if tag == 'balances': 14741 obj.balances = BalanceReader.read_many(reader) 14742 elif tag == 'comment': 14743 obj.comment = Reader.read_string(reader) 14744 elif tag == 'default_policy': 14745 obj.default_policy = Reader.read_boolean(reader) 14746 elif tag == 'description': 14747 obj.description = Reader.read_string(reader) 14748 elif tag == 'filters': 14749 obj.filters = FilterReader.read_many(reader) 14750 elif tag == 'locked': 14751 obj.locked = Reader.read_boolean(reader) 14752 elif tag == 'name': 14753 obj.name = Reader.read_string(reader) 14754 elif tag == 'properties': 14755 obj.properties = PropertyReader.read_many(reader) 14756 elif tag == 'weight': 14757 obj.weight = WeightReader.read_many(reader) 14758 elif tag == 'link': 14759 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14760 reader.next_element() 14761 else: 14762 reader.next_element() 14763 for link in links: 14764 SchedulingPolicyReader._process_link(link, obj) 14765 14766 # Discard the end tag: 14767 reader.read() 14768 14769 return obj 14770 14771 @staticmethod 14772 def read_many(reader): 14773 # Do nothing if there aren't more tags: 14774 objs = List() 14775 if not reader.forward(): 14776 return objs 14777 14778 # Process the attributes: 14779 objs.href = reader.get_attribute('href') 14780 14781 # Discard the start tag: 14782 empty = reader.empty_element() 14783 reader.read() 14784 if empty: 14785 return objs 14786 14787 # Process the inner elements: 14788 while reader.forward(): 14789 objs.append(SchedulingPolicyReader.read_one(reader)) 14790 14791 # Discard the end tag: 14792 reader.read() 14793 14794 return objs 14795 14796 @staticmethod 14797 def _process_link(link, obj): 14798 # Process the attributes: 14799 rel = link[0] 14800 href = link[1] 14801 if href and rel: 14802 if rel == "balances": 14803 if obj.balances is not None: 14804 obj.balances.href = href 14805 else: 14806 obj.balances = List(href) 14807 elif rel == "filters": 14808 if obj.filters is not None: 14809 obj.filters.href = href 14810 else: 14811 obj.filters = List(href) 14812 elif rel == "weight": 14813 if obj.weight is not None: 14814 obj.weight.href = href 14815 else: 14816 obj.weight = List(href) 14817 14818 14819class SchedulingPolicyUnitReader(Reader): 14820 14821 def __init__(self): 14822 super(SchedulingPolicyUnitReader, self).__init__() 14823 14824 @staticmethod 14825 def read_one(reader): 14826 # Do nothing if there aren't more tags: 14827 if not reader.forward(): 14828 return None 14829 14830 # Create the object: 14831 obj = types.SchedulingPolicyUnit() 14832 14833 # Process the attributes: 14834 obj.href = reader.get_attribute('href') 14835 value = reader.get_attribute('id') 14836 if value is not None: 14837 obj.id = value 14838 14839 # Discard the start tag: 14840 empty = reader.empty_element() 14841 reader.read() 14842 if empty: 14843 return obj 14844 14845 # Process the inner elements: 14846 links = [] 14847 while reader.forward(): 14848 tag = reader.node_name() 14849 if tag == 'comment': 14850 obj.comment = Reader.read_string(reader) 14851 elif tag == 'description': 14852 obj.description = Reader.read_string(reader) 14853 elif tag == 'enabled': 14854 obj.enabled = Reader.read_boolean(reader) 14855 elif tag == 'internal': 14856 obj.internal = Reader.read_boolean(reader) 14857 elif tag == 'name': 14858 obj.name = Reader.read_string(reader) 14859 elif tag == 'properties': 14860 obj.properties = PropertyReader.read_many(reader) 14861 elif tag == 'type': 14862 obj.type = Reader.read_enum(types.PolicyUnitType, reader) 14863 else: 14864 reader.next_element() 14865 for link in links: 14866 SchedulingPolicyUnitReader._process_link(link, obj) 14867 14868 # Discard the end tag: 14869 reader.read() 14870 14871 return obj 14872 14873 @staticmethod 14874 def read_many(reader): 14875 # Do nothing if there aren't more tags: 14876 objs = List() 14877 if not reader.forward(): 14878 return objs 14879 14880 # Process the attributes: 14881 objs.href = reader.get_attribute('href') 14882 14883 # Discard the start tag: 14884 empty = reader.empty_element() 14885 reader.read() 14886 if empty: 14887 return objs 14888 14889 # Process the inner elements: 14890 while reader.forward(): 14891 objs.append(SchedulingPolicyUnitReader.read_one(reader)) 14892 14893 # Discard the end tag: 14894 reader.read() 14895 14896 return objs 14897 14898 14899class SeLinuxReader(Reader): 14900 14901 def __init__(self): 14902 super(SeLinuxReader, self).__init__() 14903 14904 @staticmethod 14905 def read_one(reader): 14906 # Do nothing if there aren't more tags: 14907 if not reader.forward(): 14908 return None 14909 14910 # Create the object: 14911 obj = types.SeLinux() 14912 14913 # Process the attributes: 14914 obj.href = reader.get_attribute('href') 14915 14916 # Discard the start tag: 14917 empty = reader.empty_element() 14918 reader.read() 14919 if empty: 14920 return obj 14921 14922 # Process the inner elements: 14923 links = [] 14924 while reader.forward(): 14925 tag = reader.node_name() 14926 if tag == 'mode': 14927 obj.mode = Reader.read_enum(types.SeLinuxMode, reader) 14928 else: 14929 reader.next_element() 14930 for link in links: 14931 SeLinuxReader._process_link(link, obj) 14932 14933 # Discard the end tag: 14934 reader.read() 14935 14936 return obj 14937 14938 @staticmethod 14939 def read_many(reader): 14940 # Do nothing if there aren't more tags: 14941 objs = List() 14942 if not reader.forward(): 14943 return objs 14944 14945 # Process the attributes: 14946 objs.href = reader.get_attribute('href') 14947 14948 # Discard the start tag: 14949 empty = reader.empty_element() 14950 reader.read() 14951 if empty: 14952 return objs 14953 14954 # Process the inner elements: 14955 while reader.forward(): 14956 objs.append(SeLinuxReader.read_one(reader)) 14957 14958 # Discard the end tag: 14959 reader.read() 14960 14961 return objs 14962 14963 14964class SerialNumberReader(Reader): 14965 14966 def __init__(self): 14967 super(SerialNumberReader, self).__init__() 14968 14969 @staticmethod 14970 def read_one(reader): 14971 # Do nothing if there aren't more tags: 14972 if not reader.forward(): 14973 return None 14974 14975 # Create the object: 14976 obj = types.SerialNumber() 14977 14978 # Process the attributes: 14979 obj.href = reader.get_attribute('href') 14980 14981 # Discard the start tag: 14982 empty = reader.empty_element() 14983 reader.read() 14984 if empty: 14985 return obj 14986 14987 # Process the inner elements: 14988 links = [] 14989 while reader.forward(): 14990 tag = reader.node_name() 14991 if tag == 'policy': 14992 obj.policy = Reader.read_enum(types.SerialNumberPolicy, reader) 14993 elif tag == 'value': 14994 obj.value = Reader.read_string(reader) 14995 else: 14996 reader.next_element() 14997 for link in links: 14998 SerialNumberReader._process_link(link, obj) 14999 15000 # Discard the end tag: 15001 reader.read() 15002 15003 return obj 15004 15005 @staticmethod 15006 def read_many(reader): 15007 # Do nothing if there aren't more tags: 15008 objs = List() 15009 if not reader.forward(): 15010 return objs 15011 15012 # Process the attributes: 15013 objs.href = reader.get_attribute('href') 15014 15015 # Discard the start tag: 15016 empty = reader.empty_element() 15017 reader.read() 15018 if empty: 15019 return objs 15020 15021 # Process the inner elements: 15022 while reader.forward(): 15023 objs.append(SerialNumberReader.read_one(reader)) 15024 15025 # Discard the end tag: 15026 reader.read() 15027 15028 return objs 15029 15030 15031class SessionReader(Reader): 15032 15033 def __init__(self): 15034 super(SessionReader, self).__init__() 15035 15036 @staticmethod 15037 def read_one(reader): 15038 # Do nothing if there aren't more tags: 15039 if not reader.forward(): 15040 return None 15041 15042 # Create the object: 15043 obj = types.Session() 15044 15045 # Process the attributes: 15046 obj.href = reader.get_attribute('href') 15047 value = reader.get_attribute('id') 15048 if value is not None: 15049 obj.id = value 15050 15051 # Discard the start tag: 15052 empty = reader.empty_element() 15053 reader.read() 15054 if empty: 15055 return obj 15056 15057 # Process the inner elements: 15058 links = [] 15059 while reader.forward(): 15060 tag = reader.node_name() 15061 if tag == 'comment': 15062 obj.comment = Reader.read_string(reader) 15063 elif tag == 'console_user': 15064 obj.console_user = Reader.read_boolean(reader) 15065 elif tag == 'description': 15066 obj.description = Reader.read_string(reader) 15067 elif tag == 'ip': 15068 obj.ip = IpReader.read_one(reader) 15069 elif tag == 'name': 15070 obj.name = Reader.read_string(reader) 15071 elif tag == 'protocol': 15072 obj.protocol = Reader.read_string(reader) 15073 elif tag == 'user': 15074 obj.user = UserReader.read_one(reader) 15075 elif tag == 'vm': 15076 obj.vm = VmReader.read_one(reader) 15077 else: 15078 reader.next_element() 15079 for link in links: 15080 SessionReader._process_link(link, obj) 15081 15082 # Discard the end tag: 15083 reader.read() 15084 15085 return obj 15086 15087 @staticmethod 15088 def read_many(reader): 15089 # Do nothing if there aren't more tags: 15090 objs = List() 15091 if not reader.forward(): 15092 return objs 15093 15094 # Process the attributes: 15095 objs.href = reader.get_attribute('href') 15096 15097 # Discard the start tag: 15098 empty = reader.empty_element() 15099 reader.read() 15100 if empty: 15101 return objs 15102 15103 # Process the inner elements: 15104 while reader.forward(): 15105 objs.append(SessionReader.read_one(reader)) 15106 15107 # Discard the end tag: 15108 reader.read() 15109 15110 return objs 15111 15112 15113class SkipIfConnectivityBrokenReader(Reader): 15114 15115 def __init__(self): 15116 super(SkipIfConnectivityBrokenReader, self).__init__() 15117 15118 @staticmethod 15119 def read_one(reader): 15120 # Do nothing if there aren't more tags: 15121 if not reader.forward(): 15122 return None 15123 15124 # Create the object: 15125 obj = types.SkipIfConnectivityBroken() 15126 15127 # Process the attributes: 15128 obj.href = reader.get_attribute('href') 15129 15130 # Discard the start tag: 15131 empty = reader.empty_element() 15132 reader.read() 15133 if empty: 15134 return obj 15135 15136 # Process the inner elements: 15137 links = [] 15138 while reader.forward(): 15139 tag = reader.node_name() 15140 if tag == 'enabled': 15141 obj.enabled = Reader.read_boolean(reader) 15142 elif tag == 'threshold': 15143 obj.threshold = Reader.read_integer(reader) 15144 else: 15145 reader.next_element() 15146 for link in links: 15147 SkipIfConnectivityBrokenReader._process_link(link, obj) 15148 15149 # Discard the end tag: 15150 reader.read() 15151 15152 return obj 15153 15154 @staticmethod 15155 def read_many(reader): 15156 # Do nothing if there aren't more tags: 15157 objs = List() 15158 if not reader.forward(): 15159 return objs 15160 15161 # Process the attributes: 15162 objs.href = reader.get_attribute('href') 15163 15164 # Discard the start tag: 15165 empty = reader.empty_element() 15166 reader.read() 15167 if empty: 15168 return objs 15169 15170 # Process the inner elements: 15171 while reader.forward(): 15172 objs.append(SkipIfConnectivityBrokenReader.read_one(reader)) 15173 15174 # Discard the end tag: 15175 reader.read() 15176 15177 return objs 15178 15179 15180class SkipIfSdActiveReader(Reader): 15181 15182 def __init__(self): 15183 super(SkipIfSdActiveReader, self).__init__() 15184 15185 @staticmethod 15186 def read_one(reader): 15187 # Do nothing if there aren't more tags: 15188 if not reader.forward(): 15189 return None 15190 15191 # Create the object: 15192 obj = types.SkipIfSdActive() 15193 15194 # Process the attributes: 15195 obj.href = reader.get_attribute('href') 15196 15197 # Discard the start tag: 15198 empty = reader.empty_element() 15199 reader.read() 15200 if empty: 15201 return obj 15202 15203 # Process the inner elements: 15204 links = [] 15205 while reader.forward(): 15206 tag = reader.node_name() 15207 if tag == 'enabled': 15208 obj.enabled = Reader.read_boolean(reader) 15209 else: 15210 reader.next_element() 15211 for link in links: 15212 SkipIfSdActiveReader._process_link(link, obj) 15213 15214 # Discard the end tag: 15215 reader.read() 15216 15217 return obj 15218 15219 @staticmethod 15220 def read_many(reader): 15221 # Do nothing if there aren't more tags: 15222 objs = List() 15223 if not reader.forward(): 15224 return objs 15225 15226 # Process the attributes: 15227 objs.href = reader.get_attribute('href') 15228 15229 # Discard the start tag: 15230 empty = reader.empty_element() 15231 reader.read() 15232 if empty: 15233 return objs 15234 15235 # Process the inner elements: 15236 while reader.forward(): 15237 objs.append(SkipIfSdActiveReader.read_one(reader)) 15238 15239 # Discard the end tag: 15240 reader.read() 15241 15242 return objs 15243 15244 15245class SnapshotReader(Reader): 15246 15247 def __init__(self): 15248 super(SnapshotReader, self).__init__() 15249 15250 @staticmethod 15251 def read_one(reader): 15252 # Do nothing if there aren't more tags: 15253 if not reader.forward(): 15254 return None 15255 15256 # Create the object: 15257 obj = types.Snapshot() 15258 15259 # Process the attributes: 15260 obj.href = reader.get_attribute('href') 15261 value = reader.get_attribute('id') 15262 if value is not None: 15263 obj.id = value 15264 15265 # Discard the start tag: 15266 empty = reader.empty_element() 15267 reader.read() 15268 if empty: 15269 return obj 15270 15271 # Process the inner elements: 15272 links = [] 15273 while reader.forward(): 15274 tag = reader.node_name() 15275 if tag == 'affinity_labels': 15276 obj.affinity_labels = AffinityLabelReader.read_many(reader) 15277 elif tag == 'applications': 15278 obj.applications = ApplicationReader.read_many(reader) 15279 elif tag == 'auto_pinning_policy': 15280 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 15281 elif tag == 'bios': 15282 obj.bios = BiosReader.read_one(reader) 15283 elif tag == 'cdroms': 15284 obj.cdroms = CdromReader.read_many(reader) 15285 elif tag == 'cluster': 15286 obj.cluster = ClusterReader.read_one(reader) 15287 elif tag == 'comment': 15288 obj.comment = Reader.read_string(reader) 15289 elif tag == 'console': 15290 obj.console = ConsoleReader.read_one(reader) 15291 elif tag == 'cpu': 15292 obj.cpu = CpuReader.read_one(reader) 15293 elif tag == 'cpu_pinning_policy': 15294 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 15295 elif tag == 'cpu_profile': 15296 obj.cpu_profile = CpuProfileReader.read_one(reader) 15297 elif tag == 'cpu_shares': 15298 obj.cpu_shares = Reader.read_integer(reader) 15299 elif tag == 'creation_time': 15300 obj.creation_time = Reader.read_date(reader) 15301 elif tag == 'custom_compatibility_version': 15302 obj.custom_compatibility_version = VersionReader.read_one(reader) 15303 elif tag == 'custom_cpu_model': 15304 obj.custom_cpu_model = Reader.read_string(reader) 15305 elif tag == 'custom_emulated_machine': 15306 obj.custom_emulated_machine = Reader.read_string(reader) 15307 elif tag == 'custom_properties': 15308 obj.custom_properties = CustomPropertyReader.read_many(reader) 15309 elif tag == 'date': 15310 obj.date = Reader.read_date(reader) 15311 elif tag == 'delete_protected': 15312 obj.delete_protected = Reader.read_boolean(reader) 15313 elif tag == 'description': 15314 obj.description = Reader.read_string(reader) 15315 elif tag == 'disk_attachments': 15316 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 15317 elif tag == 'disks': 15318 obj.disks = DiskReader.read_many(reader) 15319 elif tag == 'display': 15320 obj.display = DisplayReader.read_one(reader) 15321 elif tag == 'domain': 15322 obj.domain = DomainReader.read_one(reader) 15323 elif tag == 'dynamic_cpu': 15324 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 15325 elif tag == 'external_host_provider': 15326 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 15327 elif tag == 'floppies': 15328 obj.floppies = FloppyReader.read_many(reader) 15329 elif tag == 'fqdn': 15330 obj.fqdn = Reader.read_string(reader) 15331 elif tag == 'graphics_consoles': 15332 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 15333 elif tag == 'guest_operating_system': 15334 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 15335 elif tag == 'guest_time_zone': 15336 obj.guest_time_zone = TimeZoneReader.read_one(reader) 15337 elif tag == 'has_illegal_images': 15338 obj.has_illegal_images = Reader.read_boolean(reader) 15339 elif tag == 'high_availability': 15340 obj.high_availability = HighAvailabilityReader.read_one(reader) 15341 elif tag == 'host': 15342 obj.host = HostReader.read_one(reader) 15343 elif tag == 'host_devices': 15344 obj.host_devices = HostDeviceReader.read_many(reader) 15345 elif tag == 'initialization': 15346 obj.initialization = InitializationReader.read_one(reader) 15347 elif tag == 'instance_type': 15348 obj.instance_type = InstanceTypeReader.read_one(reader) 15349 elif tag == 'io': 15350 obj.io = IoReader.read_one(reader) 15351 elif tag == 'katello_errata': 15352 obj.katello_errata = KatelloErratumReader.read_many(reader) 15353 elif tag == 'large_icon': 15354 obj.large_icon = IconReader.read_one(reader) 15355 elif tag == 'lease': 15356 obj.lease = StorageDomainLeaseReader.read_one(reader) 15357 elif tag == 'mediated_devices': 15358 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 15359 elif tag == 'memory': 15360 obj.memory = Reader.read_integer(reader) 15361 elif tag == 'memory_policy': 15362 obj.memory_policy = MemoryPolicyReader.read_one(reader) 15363 elif tag == 'migration': 15364 obj.migration = MigrationOptionsReader.read_one(reader) 15365 elif tag == 'migration_downtime': 15366 obj.migration_downtime = Reader.read_integer(reader) 15367 elif tag == 'multi_queues_enabled': 15368 obj.multi_queues_enabled = Reader.read_boolean(reader) 15369 elif tag == 'name': 15370 obj.name = Reader.read_string(reader) 15371 elif tag == 'next_run_configuration_exists': 15372 obj.next_run_configuration_exists = Reader.read_boolean(reader) 15373 elif tag == 'nics': 15374 obj.nics = NicReader.read_many(reader) 15375 elif tag == 'host_numa_nodes': 15376 obj.numa_nodes = NumaNodeReader.read_many(reader) 15377 elif tag == 'numa_tune_mode': 15378 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 15379 elif tag == 'origin': 15380 obj.origin = Reader.read_string(reader) 15381 elif tag == 'original_template': 15382 obj.original_template = TemplateReader.read_one(reader) 15383 elif tag == 'os': 15384 obj.os = OperatingSystemReader.read_one(reader) 15385 elif tag == 'payloads': 15386 obj.payloads = PayloadReader.read_many(reader) 15387 elif tag == 'permissions': 15388 obj.permissions = PermissionReader.read_many(reader) 15389 elif tag == 'persist_memorystate': 15390 obj.persist_memorystate = Reader.read_boolean(reader) 15391 elif tag == 'placement_policy': 15392 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 15393 elif tag == 'quota': 15394 obj.quota = QuotaReader.read_one(reader) 15395 elif tag == 'reported_devices': 15396 obj.reported_devices = ReportedDeviceReader.read_many(reader) 15397 elif tag == 'rng_device': 15398 obj.rng_device = RngDeviceReader.read_one(reader) 15399 elif tag == 'run_once': 15400 obj.run_once = Reader.read_boolean(reader) 15401 elif tag == 'serial_number': 15402 obj.serial_number = SerialNumberReader.read_one(reader) 15403 elif tag == 'sessions': 15404 obj.sessions = SessionReader.read_many(reader) 15405 elif tag == 'small_icon': 15406 obj.small_icon = IconReader.read_one(reader) 15407 elif tag == 'snapshot_status': 15408 obj.snapshot_status = Reader.read_enum(types.SnapshotStatus, reader) 15409 elif tag == 'snapshot_type': 15410 obj.snapshot_type = Reader.read_enum(types.SnapshotType, reader) 15411 elif tag == 'snapshots': 15412 obj.snapshots = SnapshotReader.read_many(reader) 15413 elif tag == 'soundcard_enabled': 15414 obj.soundcard_enabled = Reader.read_boolean(reader) 15415 elif tag == 'sso': 15416 obj.sso = SsoReader.read_one(reader) 15417 elif tag == 'start_paused': 15418 obj.start_paused = Reader.read_boolean(reader) 15419 elif tag == 'start_time': 15420 obj.start_time = Reader.read_date(reader) 15421 elif tag == 'stateless': 15422 obj.stateless = Reader.read_boolean(reader) 15423 elif tag == 'statistics': 15424 obj.statistics = StatisticReader.read_many(reader) 15425 elif tag == 'status': 15426 obj.status = Reader.read_enum(types.VmStatus, reader) 15427 elif tag == 'status_detail': 15428 obj.status_detail = Reader.read_string(reader) 15429 elif tag == 'stop_reason': 15430 obj.stop_reason = Reader.read_string(reader) 15431 elif tag == 'stop_time': 15432 obj.stop_time = Reader.read_date(reader) 15433 elif tag == 'storage_domain': 15434 obj.storage_domain = StorageDomainReader.read_one(reader) 15435 elif tag == 'storage_error_resume_behaviour': 15436 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 15437 elif tag == 'tags': 15438 obj.tags = TagReader.read_many(reader) 15439 elif tag == 'template': 15440 obj.template = TemplateReader.read_one(reader) 15441 elif tag == 'time_zone': 15442 obj.time_zone = TimeZoneReader.read_one(reader) 15443 elif tag == 'tpm_enabled': 15444 obj.tpm_enabled = Reader.read_boolean(reader) 15445 elif tag == 'tunnel_migration': 15446 obj.tunnel_migration = Reader.read_boolean(reader) 15447 elif tag == 'type': 15448 obj.type = Reader.read_enum(types.VmType, reader) 15449 elif tag == 'usb': 15450 obj.usb = UsbReader.read_one(reader) 15451 elif tag == 'use_latest_template_version': 15452 obj.use_latest_template_version = Reader.read_boolean(reader) 15453 elif tag == 'virtio_scsi': 15454 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 15455 elif tag == 'virtio_scsi_multi_queues': 15456 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 15457 elif tag == 'virtio_scsi_multi_queues_enabled': 15458 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 15459 elif tag == 'vm': 15460 obj.vm = VmReader.read_one(reader) 15461 elif tag == 'vm_pool': 15462 obj.vm_pool = VmPoolReader.read_one(reader) 15463 elif tag == 'watchdogs': 15464 obj.watchdogs = WatchdogReader.read_many(reader) 15465 elif tag == 'link': 15466 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 15467 reader.next_element() 15468 else: 15469 reader.next_element() 15470 for link in links: 15471 SnapshotReader._process_link(link, obj) 15472 15473 # Discard the end tag: 15474 reader.read() 15475 15476 return obj 15477 15478 @staticmethod 15479 def read_many(reader): 15480 # Do nothing if there aren't more tags: 15481 objs = List() 15482 if not reader.forward(): 15483 return objs 15484 15485 # Process the attributes: 15486 objs.href = reader.get_attribute('href') 15487 15488 # Discard the start tag: 15489 empty = reader.empty_element() 15490 reader.read() 15491 if empty: 15492 return objs 15493 15494 # Process the inner elements: 15495 while reader.forward(): 15496 objs.append(SnapshotReader.read_one(reader)) 15497 15498 # Discard the end tag: 15499 reader.read() 15500 15501 return objs 15502 15503 @staticmethod 15504 def _process_link(link, obj): 15505 # Process the attributes: 15506 rel = link[0] 15507 href = link[1] 15508 if href and rel: 15509 if rel == "affinitylabels": 15510 if obj.affinity_labels is not None: 15511 obj.affinity_labels.href = href 15512 else: 15513 obj.affinity_labels = List(href) 15514 elif rel == "applications": 15515 if obj.applications is not None: 15516 obj.applications.href = href 15517 else: 15518 obj.applications = List(href) 15519 elif rel == "cdroms": 15520 if obj.cdroms is not None: 15521 obj.cdroms.href = href 15522 else: 15523 obj.cdroms = List(href) 15524 elif rel == "diskattachments": 15525 if obj.disk_attachments is not None: 15526 obj.disk_attachments.href = href 15527 else: 15528 obj.disk_attachments = List(href) 15529 elif rel == "disks": 15530 if obj.disks is not None: 15531 obj.disks.href = href 15532 else: 15533 obj.disks = List(href) 15534 elif rel == "floppies": 15535 if obj.floppies is not None: 15536 obj.floppies.href = href 15537 else: 15538 obj.floppies = List(href) 15539 elif rel == "graphicsconsoles": 15540 if obj.graphics_consoles is not None: 15541 obj.graphics_consoles.href = href 15542 else: 15543 obj.graphics_consoles = List(href) 15544 elif rel == "hostdevices": 15545 if obj.host_devices is not None: 15546 obj.host_devices.href = href 15547 else: 15548 obj.host_devices = List(href) 15549 elif rel == "katelloerrata": 15550 if obj.katello_errata is not None: 15551 obj.katello_errata.href = href 15552 else: 15553 obj.katello_errata = List(href) 15554 elif rel == "mediateddevices": 15555 if obj.mediated_devices is not None: 15556 obj.mediated_devices.href = href 15557 else: 15558 obj.mediated_devices = List(href) 15559 elif rel == "nics": 15560 if obj.nics is not None: 15561 obj.nics.href = href 15562 else: 15563 obj.nics = List(href) 15564 elif rel == "numanodes": 15565 if obj.numa_nodes is not None: 15566 obj.numa_nodes.href = href 15567 else: 15568 obj.numa_nodes = List(href) 15569 elif rel == "permissions": 15570 if obj.permissions is not None: 15571 obj.permissions.href = href 15572 else: 15573 obj.permissions = List(href) 15574 elif rel == "reporteddevices": 15575 if obj.reported_devices is not None: 15576 obj.reported_devices.href = href 15577 else: 15578 obj.reported_devices = List(href) 15579 elif rel == "sessions": 15580 if obj.sessions is not None: 15581 obj.sessions.href = href 15582 else: 15583 obj.sessions = List(href) 15584 elif rel == "snapshots": 15585 if obj.snapshots is not None: 15586 obj.snapshots.href = href 15587 else: 15588 obj.snapshots = List(href) 15589 elif rel == "statistics": 15590 if obj.statistics is not None: 15591 obj.statistics.href = href 15592 else: 15593 obj.statistics = List(href) 15594 elif rel == "tags": 15595 if obj.tags is not None: 15596 obj.tags.href = href 15597 else: 15598 obj.tags = List(href) 15599 elif rel == "watchdogs": 15600 if obj.watchdogs is not None: 15601 obj.watchdogs.href = href 15602 else: 15603 obj.watchdogs = List(href) 15604 15605 15606class SpecialObjectsReader(Reader): 15607 15608 def __init__(self): 15609 super(SpecialObjectsReader, self).__init__() 15610 15611 @staticmethod 15612 def read_one(reader): 15613 # Do nothing if there aren't more tags: 15614 if not reader.forward(): 15615 return None 15616 15617 # Create the object: 15618 obj = types.SpecialObjects() 15619 15620 # Process the attributes: 15621 obj.href = reader.get_attribute('href') 15622 15623 # Discard the start tag: 15624 empty = reader.empty_element() 15625 reader.read() 15626 if empty: 15627 return obj 15628 15629 # Process the inner elements: 15630 links = [] 15631 while reader.forward(): 15632 tag = reader.node_name() 15633 if tag == 'blank_template': 15634 obj.blank_template = TemplateReader.read_one(reader) 15635 elif tag == 'root_tag': 15636 obj.root_tag = TagReader.read_one(reader) 15637 else: 15638 reader.next_element() 15639 for link in links: 15640 SpecialObjectsReader._process_link(link, obj) 15641 15642 # Discard the end tag: 15643 reader.read() 15644 15645 return obj 15646 15647 @staticmethod 15648 def read_many(reader): 15649 # Do nothing if there aren't more tags: 15650 objs = List() 15651 if not reader.forward(): 15652 return objs 15653 15654 # Process the attributes: 15655 objs.href = reader.get_attribute('href') 15656 15657 # Discard the start tag: 15658 empty = reader.empty_element() 15659 reader.read() 15660 if empty: 15661 return objs 15662 15663 # Process the inner elements: 15664 while reader.forward(): 15665 objs.append(SpecialObjectsReader.read_one(reader)) 15666 15667 # Discard the end tag: 15668 reader.read() 15669 15670 return objs 15671 15672 15673class SpmReader(Reader): 15674 15675 def __init__(self): 15676 super(SpmReader, self).__init__() 15677 15678 @staticmethod 15679 def read_one(reader): 15680 # Do nothing if there aren't more tags: 15681 if not reader.forward(): 15682 return None 15683 15684 # Create the object: 15685 obj = types.Spm() 15686 15687 # Process the attributes: 15688 obj.href = reader.get_attribute('href') 15689 15690 # Discard the start tag: 15691 empty = reader.empty_element() 15692 reader.read() 15693 if empty: 15694 return obj 15695 15696 # Process the inner elements: 15697 links = [] 15698 while reader.forward(): 15699 tag = reader.node_name() 15700 if tag == 'priority': 15701 obj.priority = Reader.read_integer(reader) 15702 elif tag == 'status': 15703 obj.status = Reader.read_enum(types.SpmStatus, reader) 15704 else: 15705 reader.next_element() 15706 for link in links: 15707 SpmReader._process_link(link, obj) 15708 15709 # Discard the end tag: 15710 reader.read() 15711 15712 return obj 15713 15714 @staticmethod 15715 def read_many(reader): 15716 # Do nothing if there aren't more tags: 15717 objs = List() 15718 if not reader.forward(): 15719 return objs 15720 15721 # Process the attributes: 15722 objs.href = reader.get_attribute('href') 15723 15724 # Discard the start tag: 15725 empty = reader.empty_element() 15726 reader.read() 15727 if empty: 15728 return objs 15729 15730 # Process the inner elements: 15731 while reader.forward(): 15732 objs.append(SpmReader.read_one(reader)) 15733 15734 # Discard the end tag: 15735 reader.read() 15736 15737 return objs 15738 15739 15740class SshReader(Reader): 15741 15742 def __init__(self): 15743 super(SshReader, self).__init__() 15744 15745 @staticmethod 15746 def read_one(reader): 15747 # Do nothing if there aren't more tags: 15748 if not reader.forward(): 15749 return None 15750 15751 # Create the object: 15752 obj = types.Ssh() 15753 15754 # Process the attributes: 15755 obj.href = reader.get_attribute('href') 15756 value = reader.get_attribute('id') 15757 if value is not None: 15758 obj.id = value 15759 15760 # Discard the start tag: 15761 empty = reader.empty_element() 15762 reader.read() 15763 if empty: 15764 return obj 15765 15766 # Process the inner elements: 15767 links = [] 15768 while reader.forward(): 15769 tag = reader.node_name() 15770 if tag == 'authentication_method': 15771 obj.authentication_method = Reader.read_enum(types.SshAuthenticationMethod, reader) 15772 elif tag == 'comment': 15773 obj.comment = Reader.read_string(reader) 15774 elif tag == 'description': 15775 obj.description = Reader.read_string(reader) 15776 elif tag == 'fingerprint': 15777 obj.fingerprint = Reader.read_string(reader) 15778 elif tag == 'name': 15779 obj.name = Reader.read_string(reader) 15780 elif tag == 'port': 15781 obj.port = Reader.read_integer(reader) 15782 elif tag == 'public_key': 15783 obj.public_key = Reader.read_string(reader) 15784 elif tag == 'user': 15785 obj.user = UserReader.read_one(reader) 15786 else: 15787 reader.next_element() 15788 for link in links: 15789 SshReader._process_link(link, obj) 15790 15791 # Discard the end tag: 15792 reader.read() 15793 15794 return obj 15795 15796 @staticmethod 15797 def read_many(reader): 15798 # Do nothing if there aren't more tags: 15799 objs = List() 15800 if not reader.forward(): 15801 return objs 15802 15803 # Process the attributes: 15804 objs.href = reader.get_attribute('href') 15805 15806 # Discard the start tag: 15807 empty = reader.empty_element() 15808 reader.read() 15809 if empty: 15810 return objs 15811 15812 # Process the inner elements: 15813 while reader.forward(): 15814 objs.append(SshReader.read_one(reader)) 15815 15816 # Discard the end tag: 15817 reader.read() 15818 15819 return objs 15820 15821 15822class SshPublicKeyReader(Reader): 15823 15824 def __init__(self): 15825 super(SshPublicKeyReader, self).__init__() 15826 15827 @staticmethod 15828 def read_one(reader): 15829 # Do nothing if there aren't more tags: 15830 if not reader.forward(): 15831 return None 15832 15833 # Create the object: 15834 obj = types.SshPublicKey() 15835 15836 # Process the attributes: 15837 obj.href = reader.get_attribute('href') 15838 value = reader.get_attribute('id') 15839 if value is not None: 15840 obj.id = value 15841 15842 # Discard the start tag: 15843 empty = reader.empty_element() 15844 reader.read() 15845 if empty: 15846 return obj 15847 15848 # Process the inner elements: 15849 links = [] 15850 while reader.forward(): 15851 tag = reader.node_name() 15852 if tag == 'comment': 15853 obj.comment = Reader.read_string(reader) 15854 elif tag == 'content': 15855 obj.content = Reader.read_string(reader) 15856 elif tag == 'description': 15857 obj.description = Reader.read_string(reader) 15858 elif tag == 'name': 15859 obj.name = Reader.read_string(reader) 15860 elif tag == 'user': 15861 obj.user = UserReader.read_one(reader) 15862 else: 15863 reader.next_element() 15864 for link in links: 15865 SshPublicKeyReader._process_link(link, obj) 15866 15867 # Discard the end tag: 15868 reader.read() 15869 15870 return obj 15871 15872 @staticmethod 15873 def read_many(reader): 15874 # Do nothing if there aren't more tags: 15875 objs = List() 15876 if not reader.forward(): 15877 return objs 15878 15879 # Process the attributes: 15880 objs.href = reader.get_attribute('href') 15881 15882 # Discard the start tag: 15883 empty = reader.empty_element() 15884 reader.read() 15885 if empty: 15886 return objs 15887 15888 # Process the inner elements: 15889 while reader.forward(): 15890 objs.append(SshPublicKeyReader.read_one(reader)) 15891 15892 # Discard the end tag: 15893 reader.read() 15894 15895 return objs 15896 15897 15898class SsoReader(Reader): 15899 15900 def __init__(self): 15901 super(SsoReader, self).__init__() 15902 15903 @staticmethod 15904 def read_one(reader): 15905 # Do nothing if there aren't more tags: 15906 if not reader.forward(): 15907 return None 15908 15909 # Create the object: 15910 obj = types.Sso() 15911 15912 # Process the attributes: 15913 obj.href = reader.get_attribute('href') 15914 15915 # Discard the start tag: 15916 empty = reader.empty_element() 15917 reader.read() 15918 if empty: 15919 return obj 15920 15921 # Process the inner elements: 15922 links = [] 15923 while reader.forward(): 15924 tag = reader.node_name() 15925 if tag == 'methods': 15926 obj.methods = MethodReader.read_many(reader) 15927 else: 15928 reader.next_element() 15929 for link in links: 15930 SsoReader._process_link(link, obj) 15931 15932 # Discard the end tag: 15933 reader.read() 15934 15935 return obj 15936 15937 @staticmethod 15938 def read_many(reader): 15939 # Do nothing if there aren't more tags: 15940 objs = List() 15941 if not reader.forward(): 15942 return objs 15943 15944 # Process the attributes: 15945 objs.href = reader.get_attribute('href') 15946 15947 # Discard the start tag: 15948 empty = reader.empty_element() 15949 reader.read() 15950 if empty: 15951 return objs 15952 15953 # Process the inner elements: 15954 while reader.forward(): 15955 objs.append(SsoReader.read_one(reader)) 15956 15957 # Discard the end tag: 15958 reader.read() 15959 15960 return objs 15961 15962 15963class StatisticReader(Reader): 15964 15965 def __init__(self): 15966 super(StatisticReader, self).__init__() 15967 15968 @staticmethod 15969 def read_one(reader): 15970 # Do nothing if there aren't more tags: 15971 if not reader.forward(): 15972 return None 15973 15974 # Create the object: 15975 obj = types.Statistic() 15976 15977 # Process the attributes: 15978 obj.href = reader.get_attribute('href') 15979 value = reader.get_attribute('id') 15980 if value is not None: 15981 obj.id = value 15982 15983 # Discard the start tag: 15984 empty = reader.empty_element() 15985 reader.read() 15986 if empty: 15987 return obj 15988 15989 # Process the inner elements: 15990 links = [] 15991 while reader.forward(): 15992 tag = reader.node_name() 15993 if tag == 'brick': 15994 obj.brick = GlusterBrickReader.read_one(reader) 15995 elif tag == 'comment': 15996 obj.comment = Reader.read_string(reader) 15997 elif tag == 'description': 15998 obj.description = Reader.read_string(reader) 15999 elif tag == 'disk': 16000 obj.disk = DiskReader.read_one(reader) 16001 elif tag == 'gluster_volume': 16002 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16003 elif tag == 'host': 16004 obj.host = HostReader.read_one(reader) 16005 elif tag == 'host_nic': 16006 obj.host_nic = HostNicReader.read_one(reader) 16007 elif tag == 'host_numa_node': 16008 obj.host_numa_node = NumaNodeReader.read_one(reader) 16009 elif tag == 'kind': 16010 obj.kind = Reader.read_enum(types.StatisticKind, reader) 16011 elif tag == 'name': 16012 obj.name = Reader.read_string(reader) 16013 elif tag == 'nic': 16014 obj.nic = NicReader.read_one(reader) 16015 elif tag == 'step': 16016 obj.step = StepReader.read_one(reader) 16017 elif tag == 'type': 16018 obj.type = Reader.read_enum(types.ValueType, reader) 16019 elif tag == 'unit': 16020 obj.unit = Reader.read_enum(types.StatisticUnit, reader) 16021 elif tag == 'values': 16022 obj.values = ValueReader.read_many(reader) 16023 elif tag == 'vm': 16024 obj.vm = VmReader.read_one(reader) 16025 else: 16026 reader.next_element() 16027 for link in links: 16028 StatisticReader._process_link(link, obj) 16029 16030 # Discard the end tag: 16031 reader.read() 16032 16033 return obj 16034 16035 @staticmethod 16036 def read_many(reader): 16037 # Do nothing if there aren't more tags: 16038 objs = List() 16039 if not reader.forward(): 16040 return objs 16041 16042 # Process the attributes: 16043 objs.href = reader.get_attribute('href') 16044 16045 # Discard the start tag: 16046 empty = reader.empty_element() 16047 reader.read() 16048 if empty: 16049 return objs 16050 16051 # Process the inner elements: 16052 while reader.forward(): 16053 objs.append(StatisticReader.read_one(reader)) 16054 16055 # Discard the end tag: 16056 reader.read() 16057 16058 return objs 16059 16060 16061class StepReader(Reader): 16062 16063 def __init__(self): 16064 super(StepReader, self).__init__() 16065 16066 @staticmethod 16067 def read_one(reader): 16068 # Do nothing if there aren't more tags: 16069 if not reader.forward(): 16070 return None 16071 16072 # Create the object: 16073 obj = types.Step() 16074 16075 # Process the attributes: 16076 obj.href = reader.get_attribute('href') 16077 value = reader.get_attribute('id') 16078 if value is not None: 16079 obj.id = value 16080 16081 # Discard the start tag: 16082 empty = reader.empty_element() 16083 reader.read() 16084 if empty: 16085 return obj 16086 16087 # Process the inner elements: 16088 links = [] 16089 while reader.forward(): 16090 tag = reader.node_name() 16091 if tag == 'comment': 16092 obj.comment = Reader.read_string(reader) 16093 elif tag == 'description': 16094 obj.description = Reader.read_string(reader) 16095 elif tag == 'end_time': 16096 obj.end_time = Reader.read_date(reader) 16097 elif tag == 'execution_host': 16098 obj.execution_host = HostReader.read_one(reader) 16099 elif tag == 'external': 16100 obj.external = Reader.read_boolean(reader) 16101 elif tag == 'external_type': 16102 obj.external_type = Reader.read_enum(types.ExternalSystemType, reader) 16103 elif tag == 'job': 16104 obj.job = JobReader.read_one(reader) 16105 elif tag == 'name': 16106 obj.name = Reader.read_string(reader) 16107 elif tag == 'number': 16108 obj.number = Reader.read_integer(reader) 16109 elif tag == 'parent_step': 16110 obj.parent_step = StepReader.read_one(reader) 16111 elif tag == 'progress': 16112 obj.progress = Reader.read_integer(reader) 16113 elif tag == 'start_time': 16114 obj.start_time = Reader.read_date(reader) 16115 elif tag == 'statistics': 16116 obj.statistics = StatisticReader.read_many(reader) 16117 elif tag == 'status': 16118 obj.status = Reader.read_enum(types.StepStatus, reader) 16119 elif tag == 'type': 16120 obj.type = Reader.read_enum(types.StepEnum, reader) 16121 elif tag == 'link': 16122 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16123 reader.next_element() 16124 else: 16125 reader.next_element() 16126 for link in links: 16127 StepReader._process_link(link, obj) 16128 16129 # Discard the end tag: 16130 reader.read() 16131 16132 return obj 16133 16134 @staticmethod 16135 def read_many(reader): 16136 # Do nothing if there aren't more tags: 16137 objs = List() 16138 if not reader.forward(): 16139 return objs 16140 16141 # Process the attributes: 16142 objs.href = reader.get_attribute('href') 16143 16144 # Discard the start tag: 16145 empty = reader.empty_element() 16146 reader.read() 16147 if empty: 16148 return objs 16149 16150 # Process the inner elements: 16151 while reader.forward(): 16152 objs.append(StepReader.read_one(reader)) 16153 16154 # Discard the end tag: 16155 reader.read() 16156 16157 return objs 16158 16159 @staticmethod 16160 def _process_link(link, obj): 16161 # Process the attributes: 16162 rel = link[0] 16163 href = link[1] 16164 if href and rel: 16165 if rel == "statistics": 16166 if obj.statistics is not None: 16167 obj.statistics.href = href 16168 else: 16169 obj.statistics = List(href) 16170 16171 16172class StorageConnectionReader(Reader): 16173 16174 def __init__(self): 16175 super(StorageConnectionReader, self).__init__() 16176 16177 @staticmethod 16178 def read_one(reader): 16179 # Do nothing if there aren't more tags: 16180 if not reader.forward(): 16181 return None 16182 16183 # Create the object: 16184 obj = types.StorageConnection() 16185 16186 # Process the attributes: 16187 obj.href = reader.get_attribute('href') 16188 value = reader.get_attribute('id') 16189 if value is not None: 16190 obj.id = value 16191 16192 # Discard the start tag: 16193 empty = reader.empty_element() 16194 reader.read() 16195 if empty: 16196 return obj 16197 16198 # Process the inner elements: 16199 links = [] 16200 while reader.forward(): 16201 tag = reader.node_name() 16202 if tag == 'address': 16203 obj.address = Reader.read_string(reader) 16204 elif tag == 'comment': 16205 obj.comment = Reader.read_string(reader) 16206 elif tag == 'description': 16207 obj.description = Reader.read_string(reader) 16208 elif tag == 'gluster_volume': 16209 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16210 elif tag == 'host': 16211 obj.host = HostReader.read_one(reader) 16212 elif tag == 'mount_options': 16213 obj.mount_options = Reader.read_string(reader) 16214 elif tag == 'name': 16215 obj.name = Reader.read_string(reader) 16216 elif tag == 'nfs_retrans': 16217 obj.nfs_retrans = Reader.read_integer(reader) 16218 elif tag == 'nfs_timeo': 16219 obj.nfs_timeo = Reader.read_integer(reader) 16220 elif tag == 'nfs_version': 16221 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 16222 elif tag == 'password': 16223 obj.password = Reader.read_string(reader) 16224 elif tag == 'path': 16225 obj.path = Reader.read_string(reader) 16226 elif tag == 'port': 16227 obj.port = Reader.read_integer(reader) 16228 elif tag == 'portal': 16229 obj.portal = Reader.read_string(reader) 16230 elif tag == 'target': 16231 obj.target = Reader.read_string(reader) 16232 elif tag == 'type': 16233 obj.type = Reader.read_enum(types.StorageType, reader) 16234 elif tag == 'username': 16235 obj.username = Reader.read_string(reader) 16236 elif tag == 'vfs_type': 16237 obj.vfs_type = Reader.read_string(reader) 16238 else: 16239 reader.next_element() 16240 for link in links: 16241 StorageConnectionReader._process_link(link, obj) 16242 16243 # Discard the end tag: 16244 reader.read() 16245 16246 return obj 16247 16248 @staticmethod 16249 def read_many(reader): 16250 # Do nothing if there aren't more tags: 16251 objs = List() 16252 if not reader.forward(): 16253 return objs 16254 16255 # Process the attributes: 16256 objs.href = reader.get_attribute('href') 16257 16258 # Discard the start tag: 16259 empty = reader.empty_element() 16260 reader.read() 16261 if empty: 16262 return objs 16263 16264 # Process the inner elements: 16265 while reader.forward(): 16266 objs.append(StorageConnectionReader.read_one(reader)) 16267 16268 # Discard the end tag: 16269 reader.read() 16270 16271 return objs 16272 16273 16274class StorageConnectionExtensionReader(Reader): 16275 16276 def __init__(self): 16277 super(StorageConnectionExtensionReader, self).__init__() 16278 16279 @staticmethod 16280 def read_one(reader): 16281 # Do nothing if there aren't more tags: 16282 if not reader.forward(): 16283 return None 16284 16285 # Create the object: 16286 obj = types.StorageConnectionExtension() 16287 16288 # Process the attributes: 16289 obj.href = reader.get_attribute('href') 16290 value = reader.get_attribute('id') 16291 if value is not None: 16292 obj.id = value 16293 16294 # Discard the start tag: 16295 empty = reader.empty_element() 16296 reader.read() 16297 if empty: 16298 return obj 16299 16300 # Process the inner elements: 16301 links = [] 16302 while reader.forward(): 16303 tag = reader.node_name() 16304 if tag == 'comment': 16305 obj.comment = Reader.read_string(reader) 16306 elif tag == 'description': 16307 obj.description = Reader.read_string(reader) 16308 elif tag == 'host': 16309 obj.host = HostReader.read_one(reader) 16310 elif tag == 'name': 16311 obj.name = Reader.read_string(reader) 16312 elif tag == 'password': 16313 obj.password = Reader.read_string(reader) 16314 elif tag == 'target': 16315 obj.target = Reader.read_string(reader) 16316 elif tag == 'username': 16317 obj.username = Reader.read_string(reader) 16318 else: 16319 reader.next_element() 16320 for link in links: 16321 StorageConnectionExtensionReader._process_link(link, obj) 16322 16323 # Discard the end tag: 16324 reader.read() 16325 16326 return obj 16327 16328 @staticmethod 16329 def read_many(reader): 16330 # Do nothing if there aren't more tags: 16331 objs = List() 16332 if not reader.forward(): 16333 return objs 16334 16335 # Process the attributes: 16336 objs.href = reader.get_attribute('href') 16337 16338 # Discard the start tag: 16339 empty = reader.empty_element() 16340 reader.read() 16341 if empty: 16342 return objs 16343 16344 # Process the inner elements: 16345 while reader.forward(): 16346 objs.append(StorageConnectionExtensionReader.read_one(reader)) 16347 16348 # Discard the end tag: 16349 reader.read() 16350 16351 return objs 16352 16353 16354class StorageDomainReader(Reader): 16355 16356 def __init__(self): 16357 super(StorageDomainReader, self).__init__() 16358 16359 @staticmethod 16360 def read_one(reader): 16361 # Do nothing if there aren't more tags: 16362 if not reader.forward(): 16363 return None 16364 16365 # Create the object: 16366 obj = types.StorageDomain() 16367 16368 # Process the attributes: 16369 obj.href = reader.get_attribute('href') 16370 value = reader.get_attribute('id') 16371 if value is not None: 16372 obj.id = value 16373 16374 # Discard the start tag: 16375 empty = reader.empty_element() 16376 reader.read() 16377 if empty: 16378 return obj 16379 16380 # Process the inner elements: 16381 links = [] 16382 while reader.forward(): 16383 tag = reader.node_name() 16384 if tag == 'available': 16385 obj.available = Reader.read_integer(reader) 16386 elif tag == 'backup': 16387 obj.backup = Reader.read_boolean(reader) 16388 elif tag == 'block_size': 16389 obj.block_size = Reader.read_integer(reader) 16390 elif tag == 'comment': 16391 obj.comment = Reader.read_string(reader) 16392 elif tag == 'committed': 16393 obj.committed = Reader.read_integer(reader) 16394 elif tag == 'critical_space_action_blocker': 16395 obj.critical_space_action_blocker = Reader.read_integer(reader) 16396 elif tag == 'data_center': 16397 obj.data_center = DataCenterReader.read_one(reader) 16398 elif tag == 'data_centers': 16399 obj.data_centers = DataCenterReader.read_many(reader) 16400 elif tag == 'description': 16401 obj.description = Reader.read_string(reader) 16402 elif tag == 'discard_after_delete': 16403 obj.discard_after_delete = Reader.read_boolean(reader) 16404 elif tag == 'disk_profiles': 16405 obj.disk_profiles = DiskProfileReader.read_many(reader) 16406 elif tag == 'disk_snapshots': 16407 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 16408 elif tag == 'disks': 16409 obj.disks = DiskReader.read_many(reader) 16410 elif tag == 'external_status': 16411 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 16412 elif tag == 'files': 16413 obj.files = FileReader.read_many(reader) 16414 elif tag == 'host': 16415 obj.host = HostReader.read_one(reader) 16416 elif tag == 'images': 16417 obj.images = ImageReader.read_many(reader) 16418 elif tag == 'import': 16419 obj.import_ = Reader.read_boolean(reader) 16420 elif tag == 'master': 16421 obj.master = Reader.read_boolean(reader) 16422 elif tag == 'name': 16423 obj.name = Reader.read_string(reader) 16424 elif tag == 'permissions': 16425 obj.permissions = PermissionReader.read_many(reader) 16426 elif tag == 'status': 16427 obj.status = Reader.read_enum(types.StorageDomainStatus, reader) 16428 elif tag == 'storage': 16429 obj.storage = HostStorageReader.read_one(reader) 16430 elif tag == 'storage_connections': 16431 obj.storage_connections = StorageConnectionReader.read_many(reader) 16432 elif tag == 'storage_format': 16433 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 16434 elif tag == 'supports_discard': 16435 obj.supports_discard = Reader.read_boolean(reader) 16436 elif tag == 'supports_discard_zeroes_data': 16437 obj.supports_discard_zeroes_data = Reader.read_boolean(reader) 16438 elif tag == 'templates': 16439 obj.templates = TemplateReader.read_many(reader) 16440 elif tag == 'type': 16441 obj.type = Reader.read_enum(types.StorageDomainType, reader) 16442 elif tag == 'used': 16443 obj.used = Reader.read_integer(reader) 16444 elif tag == 'vms': 16445 obj.vms = VmReader.read_many(reader) 16446 elif tag == 'warning_low_space_indicator': 16447 obj.warning_low_space_indicator = Reader.read_integer(reader) 16448 elif tag == 'wipe_after_delete': 16449 obj.wipe_after_delete = Reader.read_boolean(reader) 16450 elif tag == 'link': 16451 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16452 reader.next_element() 16453 else: 16454 reader.next_element() 16455 for link in links: 16456 StorageDomainReader._process_link(link, obj) 16457 16458 # Discard the end tag: 16459 reader.read() 16460 16461 return obj 16462 16463 @staticmethod 16464 def read_many(reader): 16465 # Do nothing if there aren't more tags: 16466 objs = List() 16467 if not reader.forward(): 16468 return objs 16469 16470 # Process the attributes: 16471 objs.href = reader.get_attribute('href') 16472 16473 # Discard the start tag: 16474 empty = reader.empty_element() 16475 reader.read() 16476 if empty: 16477 return objs 16478 16479 # Process the inner elements: 16480 while reader.forward(): 16481 objs.append(StorageDomainReader.read_one(reader)) 16482 16483 # Discard the end tag: 16484 reader.read() 16485 16486 return objs 16487 16488 @staticmethod 16489 def _process_link(link, obj): 16490 # Process the attributes: 16491 rel = link[0] 16492 href = link[1] 16493 if href and rel: 16494 if rel == "datacenters": 16495 if obj.data_centers is not None: 16496 obj.data_centers.href = href 16497 else: 16498 obj.data_centers = List(href) 16499 elif rel == "diskprofiles": 16500 if obj.disk_profiles is not None: 16501 obj.disk_profiles.href = href 16502 else: 16503 obj.disk_profiles = List(href) 16504 elif rel == "disksnapshots": 16505 if obj.disk_snapshots is not None: 16506 obj.disk_snapshots.href = href 16507 else: 16508 obj.disk_snapshots = List(href) 16509 elif rel == "disks": 16510 if obj.disks is not None: 16511 obj.disks.href = href 16512 else: 16513 obj.disks = List(href) 16514 elif rel == "files": 16515 if obj.files is not None: 16516 obj.files.href = href 16517 else: 16518 obj.files = List(href) 16519 elif rel == "images": 16520 if obj.images is not None: 16521 obj.images.href = href 16522 else: 16523 obj.images = List(href) 16524 elif rel == "permissions": 16525 if obj.permissions is not None: 16526 obj.permissions.href = href 16527 else: 16528 obj.permissions = List(href) 16529 elif rel == "storageconnections": 16530 if obj.storage_connections is not None: 16531 obj.storage_connections.href = href 16532 else: 16533 obj.storage_connections = List(href) 16534 elif rel == "templates": 16535 if obj.templates is not None: 16536 obj.templates.href = href 16537 else: 16538 obj.templates = List(href) 16539 elif rel == "vms": 16540 if obj.vms is not None: 16541 obj.vms.href = href 16542 else: 16543 obj.vms = List(href) 16544 16545 16546class StorageDomainLeaseReader(Reader): 16547 16548 def __init__(self): 16549 super(StorageDomainLeaseReader, self).__init__() 16550 16551 @staticmethod 16552 def read_one(reader): 16553 # Do nothing if there aren't more tags: 16554 if not reader.forward(): 16555 return None 16556 16557 # Create the object: 16558 obj = types.StorageDomainLease() 16559 16560 # Process the attributes: 16561 obj.href = reader.get_attribute('href') 16562 16563 # Discard the start tag: 16564 empty = reader.empty_element() 16565 reader.read() 16566 if empty: 16567 return obj 16568 16569 # Process the inner elements: 16570 links = [] 16571 while reader.forward(): 16572 tag = reader.node_name() 16573 if tag == 'storage_domain': 16574 obj.storage_domain = StorageDomainReader.read_one(reader) 16575 else: 16576 reader.next_element() 16577 for link in links: 16578 StorageDomainLeaseReader._process_link(link, obj) 16579 16580 # Discard the end tag: 16581 reader.read() 16582 16583 return obj 16584 16585 @staticmethod 16586 def read_many(reader): 16587 # Do nothing if there aren't more tags: 16588 objs = List() 16589 if not reader.forward(): 16590 return objs 16591 16592 # Process the attributes: 16593 objs.href = reader.get_attribute('href') 16594 16595 # Discard the start tag: 16596 empty = reader.empty_element() 16597 reader.read() 16598 if empty: 16599 return objs 16600 16601 # Process the inner elements: 16602 while reader.forward(): 16603 objs.append(StorageDomainLeaseReader.read_one(reader)) 16604 16605 # Discard the end tag: 16606 reader.read() 16607 16608 return objs 16609 16610 16611class SystemOptionReader(Reader): 16612 16613 def __init__(self): 16614 super(SystemOptionReader, self).__init__() 16615 16616 @staticmethod 16617 def read_one(reader): 16618 # Do nothing if there aren't more tags: 16619 if not reader.forward(): 16620 return None 16621 16622 # Create the object: 16623 obj = types.SystemOption() 16624 16625 # Process the attributes: 16626 obj.href = reader.get_attribute('href') 16627 value = reader.get_attribute('id') 16628 if value is not None: 16629 obj.id = value 16630 16631 # Discard the start tag: 16632 empty = reader.empty_element() 16633 reader.read() 16634 if empty: 16635 return obj 16636 16637 # Process the inner elements: 16638 links = [] 16639 while reader.forward(): 16640 tag = reader.node_name() 16641 if tag == 'comment': 16642 obj.comment = Reader.read_string(reader) 16643 elif tag == 'description': 16644 obj.description = Reader.read_string(reader) 16645 elif tag == 'name': 16646 obj.name = Reader.read_string(reader) 16647 elif tag == 'values': 16648 obj.values = SystemOptionValueReader.read_many(reader) 16649 else: 16650 reader.next_element() 16651 for link in links: 16652 SystemOptionReader._process_link(link, obj) 16653 16654 # Discard the end tag: 16655 reader.read() 16656 16657 return obj 16658 16659 @staticmethod 16660 def read_many(reader): 16661 # Do nothing if there aren't more tags: 16662 objs = List() 16663 if not reader.forward(): 16664 return objs 16665 16666 # Process the attributes: 16667 objs.href = reader.get_attribute('href') 16668 16669 # Discard the start tag: 16670 empty = reader.empty_element() 16671 reader.read() 16672 if empty: 16673 return objs 16674 16675 # Process the inner elements: 16676 while reader.forward(): 16677 objs.append(SystemOptionReader.read_one(reader)) 16678 16679 # Discard the end tag: 16680 reader.read() 16681 16682 return objs 16683 16684 16685class SystemOptionValueReader(Reader): 16686 16687 def __init__(self): 16688 super(SystemOptionValueReader, self).__init__() 16689 16690 @staticmethod 16691 def read_one(reader): 16692 # Do nothing if there aren't more tags: 16693 if not reader.forward(): 16694 return None 16695 16696 # Create the object: 16697 obj = types.SystemOptionValue() 16698 16699 # Process the attributes: 16700 obj.href = reader.get_attribute('href') 16701 16702 # Discard the start tag: 16703 empty = reader.empty_element() 16704 reader.read() 16705 if empty: 16706 return obj 16707 16708 # Process the inner elements: 16709 links = [] 16710 while reader.forward(): 16711 tag = reader.node_name() 16712 if tag == 'value': 16713 obj.value = Reader.read_string(reader) 16714 elif tag == 'version': 16715 obj.version = Reader.read_string(reader) 16716 else: 16717 reader.next_element() 16718 for link in links: 16719 SystemOptionValueReader._process_link(link, obj) 16720 16721 # Discard the end tag: 16722 reader.read() 16723 16724 return obj 16725 16726 @staticmethod 16727 def read_many(reader): 16728 # Do nothing if there aren't more tags: 16729 objs = List() 16730 if not reader.forward(): 16731 return objs 16732 16733 # Process the attributes: 16734 objs.href = reader.get_attribute('href') 16735 16736 # Discard the start tag: 16737 empty = reader.empty_element() 16738 reader.read() 16739 if empty: 16740 return objs 16741 16742 # Process the inner elements: 16743 while reader.forward(): 16744 objs.append(SystemOptionValueReader.read_one(reader)) 16745 16746 # Discard the end tag: 16747 reader.read() 16748 16749 return objs 16750 16751 16752class TagReader(Reader): 16753 16754 def __init__(self): 16755 super(TagReader, self).__init__() 16756 16757 @staticmethod 16758 def read_one(reader): 16759 # Do nothing if there aren't more tags: 16760 if not reader.forward(): 16761 return None 16762 16763 # Create the object: 16764 obj = types.Tag() 16765 16766 # Process the attributes: 16767 obj.href = reader.get_attribute('href') 16768 value = reader.get_attribute('id') 16769 if value is not None: 16770 obj.id = value 16771 16772 # Discard the start tag: 16773 empty = reader.empty_element() 16774 reader.read() 16775 if empty: 16776 return obj 16777 16778 # Process the inner elements: 16779 links = [] 16780 while reader.forward(): 16781 tag = reader.node_name() 16782 if tag == 'comment': 16783 obj.comment = Reader.read_string(reader) 16784 elif tag == 'description': 16785 obj.description = Reader.read_string(reader) 16786 elif tag == 'group': 16787 obj.group = GroupReader.read_one(reader) 16788 elif tag == 'host': 16789 obj.host = HostReader.read_one(reader) 16790 elif tag == 'name': 16791 obj.name = Reader.read_string(reader) 16792 elif tag == 'parent': 16793 obj.parent = TagReader.read_one(reader) 16794 elif tag == 'template': 16795 obj.template = TemplateReader.read_one(reader) 16796 elif tag == 'user': 16797 obj.user = UserReader.read_one(reader) 16798 elif tag == 'vm': 16799 obj.vm = VmReader.read_one(reader) 16800 else: 16801 reader.next_element() 16802 for link in links: 16803 TagReader._process_link(link, obj) 16804 16805 # Discard the end tag: 16806 reader.read() 16807 16808 return obj 16809 16810 @staticmethod 16811 def read_many(reader): 16812 # Do nothing if there aren't more tags: 16813 objs = List() 16814 if not reader.forward(): 16815 return objs 16816 16817 # Process the attributes: 16818 objs.href = reader.get_attribute('href') 16819 16820 # Discard the start tag: 16821 empty = reader.empty_element() 16822 reader.read() 16823 if empty: 16824 return objs 16825 16826 # Process the inner elements: 16827 while reader.forward(): 16828 objs.append(TagReader.read_one(reader)) 16829 16830 # Discard the end tag: 16831 reader.read() 16832 16833 return objs 16834 16835 16836class TemplateReader(Reader): 16837 16838 def __init__(self): 16839 super(TemplateReader, self).__init__() 16840 16841 @staticmethod 16842 def read_one(reader): 16843 # Do nothing if there aren't more tags: 16844 if not reader.forward(): 16845 return None 16846 16847 # Create the object: 16848 obj = types.Template() 16849 16850 # Process the attributes: 16851 obj.href = reader.get_attribute('href') 16852 value = reader.get_attribute('id') 16853 if value is not None: 16854 obj.id = value 16855 16856 # Discard the start tag: 16857 empty = reader.empty_element() 16858 reader.read() 16859 if empty: 16860 return obj 16861 16862 # Process the inner elements: 16863 links = [] 16864 while reader.forward(): 16865 tag = reader.node_name() 16866 if tag == 'auto_pinning_policy': 16867 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 16868 elif tag == 'bios': 16869 obj.bios = BiosReader.read_one(reader) 16870 elif tag == 'cdroms': 16871 obj.cdroms = CdromReader.read_many(reader) 16872 elif tag == 'cluster': 16873 obj.cluster = ClusterReader.read_one(reader) 16874 elif tag == 'comment': 16875 obj.comment = Reader.read_string(reader) 16876 elif tag == 'console': 16877 obj.console = ConsoleReader.read_one(reader) 16878 elif tag == 'cpu': 16879 obj.cpu = CpuReader.read_one(reader) 16880 elif tag == 'cpu_pinning_policy': 16881 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 16882 elif tag == 'cpu_profile': 16883 obj.cpu_profile = CpuProfileReader.read_one(reader) 16884 elif tag == 'cpu_shares': 16885 obj.cpu_shares = Reader.read_integer(reader) 16886 elif tag == 'creation_time': 16887 obj.creation_time = Reader.read_date(reader) 16888 elif tag == 'custom_compatibility_version': 16889 obj.custom_compatibility_version = VersionReader.read_one(reader) 16890 elif tag == 'custom_cpu_model': 16891 obj.custom_cpu_model = Reader.read_string(reader) 16892 elif tag == 'custom_emulated_machine': 16893 obj.custom_emulated_machine = Reader.read_string(reader) 16894 elif tag == 'custom_properties': 16895 obj.custom_properties = CustomPropertyReader.read_many(reader) 16896 elif tag == 'delete_protected': 16897 obj.delete_protected = Reader.read_boolean(reader) 16898 elif tag == 'description': 16899 obj.description = Reader.read_string(reader) 16900 elif tag == 'disk_attachments': 16901 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 16902 elif tag == 'display': 16903 obj.display = DisplayReader.read_one(reader) 16904 elif tag == 'domain': 16905 obj.domain = DomainReader.read_one(reader) 16906 elif tag == 'graphics_consoles': 16907 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 16908 elif tag == 'high_availability': 16909 obj.high_availability = HighAvailabilityReader.read_one(reader) 16910 elif tag == 'initialization': 16911 obj.initialization = InitializationReader.read_one(reader) 16912 elif tag == 'io': 16913 obj.io = IoReader.read_one(reader) 16914 elif tag == 'large_icon': 16915 obj.large_icon = IconReader.read_one(reader) 16916 elif tag == 'lease': 16917 obj.lease = StorageDomainLeaseReader.read_one(reader) 16918 elif tag == 'mediated_devices': 16919 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 16920 elif tag == 'memory': 16921 obj.memory = Reader.read_integer(reader) 16922 elif tag == 'memory_policy': 16923 obj.memory_policy = MemoryPolicyReader.read_one(reader) 16924 elif tag == 'migration': 16925 obj.migration = MigrationOptionsReader.read_one(reader) 16926 elif tag == 'migration_downtime': 16927 obj.migration_downtime = Reader.read_integer(reader) 16928 elif tag == 'multi_queues_enabled': 16929 obj.multi_queues_enabled = Reader.read_boolean(reader) 16930 elif tag == 'name': 16931 obj.name = Reader.read_string(reader) 16932 elif tag == 'nics': 16933 obj.nics = NicReader.read_many(reader) 16934 elif tag == 'origin': 16935 obj.origin = Reader.read_string(reader) 16936 elif tag == 'os': 16937 obj.os = OperatingSystemReader.read_one(reader) 16938 elif tag == 'permissions': 16939 obj.permissions = PermissionReader.read_many(reader) 16940 elif tag == 'placement_policy': 16941 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 16942 elif tag == 'quota': 16943 obj.quota = QuotaReader.read_one(reader) 16944 elif tag == 'rng_device': 16945 obj.rng_device = RngDeviceReader.read_one(reader) 16946 elif tag == 'serial_number': 16947 obj.serial_number = SerialNumberReader.read_one(reader) 16948 elif tag == 'small_icon': 16949 obj.small_icon = IconReader.read_one(reader) 16950 elif tag == 'soundcard_enabled': 16951 obj.soundcard_enabled = Reader.read_boolean(reader) 16952 elif tag == 'sso': 16953 obj.sso = SsoReader.read_one(reader) 16954 elif tag == 'start_paused': 16955 obj.start_paused = Reader.read_boolean(reader) 16956 elif tag == 'stateless': 16957 obj.stateless = Reader.read_boolean(reader) 16958 elif tag == 'status': 16959 obj.status = Reader.read_enum(types.TemplateStatus, reader) 16960 elif tag == 'storage_domain': 16961 obj.storage_domain = StorageDomainReader.read_one(reader) 16962 elif tag == 'storage_error_resume_behaviour': 16963 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 16964 elif tag == 'tags': 16965 obj.tags = TagReader.read_many(reader) 16966 elif tag == 'time_zone': 16967 obj.time_zone = TimeZoneReader.read_one(reader) 16968 elif tag == 'tpm_enabled': 16969 obj.tpm_enabled = Reader.read_boolean(reader) 16970 elif tag == 'tunnel_migration': 16971 obj.tunnel_migration = Reader.read_boolean(reader) 16972 elif tag == 'type': 16973 obj.type = Reader.read_enum(types.VmType, reader) 16974 elif tag == 'usb': 16975 obj.usb = UsbReader.read_one(reader) 16976 elif tag == 'version': 16977 obj.version = TemplateVersionReader.read_one(reader) 16978 elif tag == 'virtio_scsi': 16979 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 16980 elif tag == 'virtio_scsi_multi_queues': 16981 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 16982 elif tag == 'virtio_scsi_multi_queues_enabled': 16983 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 16984 elif tag == 'vm': 16985 obj.vm = VmReader.read_one(reader) 16986 elif tag == 'watchdogs': 16987 obj.watchdogs = WatchdogReader.read_many(reader) 16988 elif tag == 'link': 16989 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16990 reader.next_element() 16991 else: 16992 reader.next_element() 16993 for link in links: 16994 TemplateReader._process_link(link, obj) 16995 16996 # Discard the end tag: 16997 reader.read() 16998 16999 return obj 17000 17001 @staticmethod 17002 def read_many(reader): 17003 # Do nothing if there aren't more tags: 17004 objs = List() 17005 if not reader.forward(): 17006 return objs 17007 17008 # Process the attributes: 17009 objs.href = reader.get_attribute('href') 17010 17011 # Discard the start tag: 17012 empty = reader.empty_element() 17013 reader.read() 17014 if empty: 17015 return objs 17016 17017 # Process the inner elements: 17018 while reader.forward(): 17019 objs.append(TemplateReader.read_one(reader)) 17020 17021 # Discard the end tag: 17022 reader.read() 17023 17024 return objs 17025 17026 @staticmethod 17027 def _process_link(link, obj): 17028 # Process the attributes: 17029 rel = link[0] 17030 href = link[1] 17031 if href and rel: 17032 if rel == "cdroms": 17033 if obj.cdroms is not None: 17034 obj.cdroms.href = href 17035 else: 17036 obj.cdroms = List(href) 17037 elif rel == "diskattachments": 17038 if obj.disk_attachments is not None: 17039 obj.disk_attachments.href = href 17040 else: 17041 obj.disk_attachments = List(href) 17042 elif rel == "graphicsconsoles": 17043 if obj.graphics_consoles is not None: 17044 obj.graphics_consoles.href = href 17045 else: 17046 obj.graphics_consoles = List(href) 17047 elif rel == "mediateddevices": 17048 if obj.mediated_devices is not None: 17049 obj.mediated_devices.href = href 17050 else: 17051 obj.mediated_devices = List(href) 17052 elif rel == "nics": 17053 if obj.nics is not None: 17054 obj.nics.href = href 17055 else: 17056 obj.nics = List(href) 17057 elif rel == "permissions": 17058 if obj.permissions is not None: 17059 obj.permissions.href = href 17060 else: 17061 obj.permissions = List(href) 17062 elif rel == "tags": 17063 if obj.tags is not None: 17064 obj.tags.href = href 17065 else: 17066 obj.tags = List(href) 17067 elif rel == "watchdogs": 17068 if obj.watchdogs is not None: 17069 obj.watchdogs.href = href 17070 else: 17071 obj.watchdogs = List(href) 17072 17073 17074class TemplateVersionReader(Reader): 17075 17076 def __init__(self): 17077 super(TemplateVersionReader, self).__init__() 17078 17079 @staticmethod 17080 def read_one(reader): 17081 # Do nothing if there aren't more tags: 17082 if not reader.forward(): 17083 return None 17084 17085 # Create the object: 17086 obj = types.TemplateVersion() 17087 17088 # Process the attributes: 17089 obj.href = reader.get_attribute('href') 17090 17091 # Discard the start tag: 17092 empty = reader.empty_element() 17093 reader.read() 17094 if empty: 17095 return obj 17096 17097 # Process the inner elements: 17098 links = [] 17099 while reader.forward(): 17100 tag = reader.node_name() 17101 if tag == 'base_template': 17102 obj.base_template = TemplateReader.read_one(reader) 17103 elif tag == 'version_name': 17104 obj.version_name = Reader.read_string(reader) 17105 elif tag == 'version_number': 17106 obj.version_number = Reader.read_integer(reader) 17107 else: 17108 reader.next_element() 17109 for link in links: 17110 TemplateVersionReader._process_link(link, obj) 17111 17112 # Discard the end tag: 17113 reader.read() 17114 17115 return obj 17116 17117 @staticmethod 17118 def read_many(reader): 17119 # Do nothing if there aren't more tags: 17120 objs = List() 17121 if not reader.forward(): 17122 return objs 17123 17124 # Process the attributes: 17125 objs.href = reader.get_attribute('href') 17126 17127 # Discard the start tag: 17128 empty = reader.empty_element() 17129 reader.read() 17130 if empty: 17131 return objs 17132 17133 # Process the inner elements: 17134 while reader.forward(): 17135 objs.append(TemplateVersionReader.read_one(reader)) 17136 17137 # Discard the end tag: 17138 reader.read() 17139 17140 return objs 17141 17142 17143class TicketReader(Reader): 17144 17145 def __init__(self): 17146 super(TicketReader, self).__init__() 17147 17148 @staticmethod 17149 def read_one(reader): 17150 # Do nothing if there aren't more tags: 17151 if not reader.forward(): 17152 return None 17153 17154 # Create the object: 17155 obj = types.Ticket() 17156 17157 # Process the attributes: 17158 obj.href = reader.get_attribute('href') 17159 17160 # Discard the start tag: 17161 empty = reader.empty_element() 17162 reader.read() 17163 if empty: 17164 return obj 17165 17166 # Process the inner elements: 17167 links = [] 17168 while reader.forward(): 17169 tag = reader.node_name() 17170 if tag == 'expiry': 17171 obj.expiry = Reader.read_integer(reader) 17172 elif tag == 'value': 17173 obj.value = Reader.read_string(reader) 17174 else: 17175 reader.next_element() 17176 for link in links: 17177 TicketReader._process_link(link, obj) 17178 17179 # Discard the end tag: 17180 reader.read() 17181 17182 return obj 17183 17184 @staticmethod 17185 def read_many(reader): 17186 # Do nothing if there aren't more tags: 17187 objs = List() 17188 if not reader.forward(): 17189 return objs 17190 17191 # Process the attributes: 17192 objs.href = reader.get_attribute('href') 17193 17194 # Discard the start tag: 17195 empty = reader.empty_element() 17196 reader.read() 17197 if empty: 17198 return objs 17199 17200 # Process the inner elements: 17201 while reader.forward(): 17202 objs.append(TicketReader.read_one(reader)) 17203 17204 # Discard the end tag: 17205 reader.read() 17206 17207 return objs 17208 17209 17210class TimeZoneReader(Reader): 17211 17212 def __init__(self): 17213 super(TimeZoneReader, self).__init__() 17214 17215 @staticmethod 17216 def read_one(reader): 17217 # Do nothing if there aren't more tags: 17218 if not reader.forward(): 17219 return None 17220 17221 # Create the object: 17222 obj = types.TimeZone() 17223 17224 # Process the attributes: 17225 obj.href = reader.get_attribute('href') 17226 17227 # Discard the start tag: 17228 empty = reader.empty_element() 17229 reader.read() 17230 if empty: 17231 return obj 17232 17233 # Process the inner elements: 17234 links = [] 17235 while reader.forward(): 17236 tag = reader.node_name() 17237 if tag == 'name': 17238 obj.name = Reader.read_string(reader) 17239 elif tag == 'utc_offset': 17240 obj.utc_offset = Reader.read_string(reader) 17241 else: 17242 reader.next_element() 17243 for link in links: 17244 TimeZoneReader._process_link(link, obj) 17245 17246 # Discard the end tag: 17247 reader.read() 17248 17249 return obj 17250 17251 @staticmethod 17252 def read_many(reader): 17253 # Do nothing if there aren't more tags: 17254 objs = List() 17255 if not reader.forward(): 17256 return objs 17257 17258 # Process the attributes: 17259 objs.href = reader.get_attribute('href') 17260 17261 # Discard the start tag: 17262 empty = reader.empty_element() 17263 reader.read() 17264 if empty: 17265 return objs 17266 17267 # Process the inner elements: 17268 while reader.forward(): 17269 objs.append(TimeZoneReader.read_one(reader)) 17270 17271 # Discard the end tag: 17272 reader.read() 17273 17274 return objs 17275 17276 17277class TransparentHugePagesReader(Reader): 17278 17279 def __init__(self): 17280 super(TransparentHugePagesReader, self).__init__() 17281 17282 @staticmethod 17283 def read_one(reader): 17284 # Do nothing if there aren't more tags: 17285 if not reader.forward(): 17286 return None 17287 17288 # Create the object: 17289 obj = types.TransparentHugePages() 17290 17291 # Process the attributes: 17292 obj.href = reader.get_attribute('href') 17293 17294 # Discard the start tag: 17295 empty = reader.empty_element() 17296 reader.read() 17297 if empty: 17298 return obj 17299 17300 # Process the inner elements: 17301 links = [] 17302 while reader.forward(): 17303 tag = reader.node_name() 17304 if tag == 'enabled': 17305 obj.enabled = Reader.read_boolean(reader) 17306 else: 17307 reader.next_element() 17308 for link in links: 17309 TransparentHugePagesReader._process_link(link, obj) 17310 17311 # Discard the end tag: 17312 reader.read() 17313 17314 return obj 17315 17316 @staticmethod 17317 def read_many(reader): 17318 # Do nothing if there aren't more tags: 17319 objs = List() 17320 if not reader.forward(): 17321 return objs 17322 17323 # Process the attributes: 17324 objs.href = reader.get_attribute('href') 17325 17326 # Discard the start tag: 17327 empty = reader.empty_element() 17328 reader.read() 17329 if empty: 17330 return objs 17331 17332 # Process the inner elements: 17333 while reader.forward(): 17334 objs.append(TransparentHugePagesReader.read_one(reader)) 17335 17336 # Discard the end tag: 17337 reader.read() 17338 17339 return objs 17340 17341 17342class UnmanagedNetworkReader(Reader): 17343 17344 def __init__(self): 17345 super(UnmanagedNetworkReader, self).__init__() 17346 17347 @staticmethod 17348 def read_one(reader): 17349 # Do nothing if there aren't more tags: 17350 if not reader.forward(): 17351 return None 17352 17353 # Create the object: 17354 obj = types.UnmanagedNetwork() 17355 17356 # Process the attributes: 17357 obj.href = reader.get_attribute('href') 17358 value = reader.get_attribute('id') 17359 if value is not None: 17360 obj.id = value 17361 17362 # Discard the start tag: 17363 empty = reader.empty_element() 17364 reader.read() 17365 if empty: 17366 return obj 17367 17368 # Process the inner elements: 17369 links = [] 17370 while reader.forward(): 17371 tag = reader.node_name() 17372 if tag == 'comment': 17373 obj.comment = Reader.read_string(reader) 17374 elif tag == 'description': 17375 obj.description = Reader.read_string(reader) 17376 elif tag == 'host': 17377 obj.host = HostReader.read_one(reader) 17378 elif tag == 'host_nic': 17379 obj.host_nic = HostNicReader.read_one(reader) 17380 elif tag == 'name': 17381 obj.name = Reader.read_string(reader) 17382 else: 17383 reader.next_element() 17384 for link in links: 17385 UnmanagedNetworkReader._process_link(link, obj) 17386 17387 # Discard the end tag: 17388 reader.read() 17389 17390 return obj 17391 17392 @staticmethod 17393 def read_many(reader): 17394 # Do nothing if there aren't more tags: 17395 objs = List() 17396 if not reader.forward(): 17397 return objs 17398 17399 # Process the attributes: 17400 objs.href = reader.get_attribute('href') 17401 17402 # Discard the start tag: 17403 empty = reader.empty_element() 17404 reader.read() 17405 if empty: 17406 return objs 17407 17408 # Process the inner elements: 17409 while reader.forward(): 17410 objs.append(UnmanagedNetworkReader.read_one(reader)) 17411 17412 # Discard the end tag: 17413 reader.read() 17414 17415 return objs 17416 17417 17418class UsbReader(Reader): 17419 17420 def __init__(self): 17421 super(UsbReader, self).__init__() 17422 17423 @staticmethod 17424 def read_one(reader): 17425 # Do nothing if there aren't more tags: 17426 if not reader.forward(): 17427 return None 17428 17429 # Create the object: 17430 obj = types.Usb() 17431 17432 # Process the attributes: 17433 obj.href = reader.get_attribute('href') 17434 17435 # Discard the start tag: 17436 empty = reader.empty_element() 17437 reader.read() 17438 if empty: 17439 return obj 17440 17441 # Process the inner elements: 17442 links = [] 17443 while reader.forward(): 17444 tag = reader.node_name() 17445 if tag == 'enabled': 17446 obj.enabled = Reader.read_boolean(reader) 17447 elif tag == 'type': 17448 obj.type = Reader.read_enum(types.UsbType, reader) 17449 else: 17450 reader.next_element() 17451 for link in links: 17452 UsbReader._process_link(link, obj) 17453 17454 # Discard the end tag: 17455 reader.read() 17456 17457 return obj 17458 17459 @staticmethod 17460 def read_many(reader): 17461 # Do nothing if there aren't more tags: 17462 objs = List() 17463 if not reader.forward(): 17464 return objs 17465 17466 # Process the attributes: 17467 objs.href = reader.get_attribute('href') 17468 17469 # Discard the start tag: 17470 empty = reader.empty_element() 17471 reader.read() 17472 if empty: 17473 return objs 17474 17475 # Process the inner elements: 17476 while reader.forward(): 17477 objs.append(UsbReader.read_one(reader)) 17478 17479 # Discard the end tag: 17480 reader.read() 17481 17482 return objs 17483 17484 17485class UserReader(Reader): 17486 17487 def __init__(self): 17488 super(UserReader, self).__init__() 17489 17490 @staticmethod 17491 def read_one(reader): 17492 # Do nothing if there aren't more tags: 17493 if not reader.forward(): 17494 return None 17495 17496 # Create the object: 17497 obj = types.User() 17498 17499 # Process the attributes: 17500 obj.href = reader.get_attribute('href') 17501 value = reader.get_attribute('id') 17502 if value is not None: 17503 obj.id = value 17504 17505 # Discard the start tag: 17506 empty = reader.empty_element() 17507 reader.read() 17508 if empty: 17509 return obj 17510 17511 # Process the inner elements: 17512 links = [] 17513 while reader.forward(): 17514 tag = reader.node_name() 17515 if tag == 'comment': 17516 obj.comment = Reader.read_string(reader) 17517 elif tag == 'department': 17518 obj.department = Reader.read_string(reader) 17519 elif tag == 'description': 17520 obj.description = Reader.read_string(reader) 17521 elif tag == 'domain': 17522 obj.domain = DomainReader.read_one(reader) 17523 elif tag == 'domain_entry_id': 17524 obj.domain_entry_id = Reader.read_string(reader) 17525 elif tag == 'email': 17526 obj.email = Reader.read_string(reader) 17527 elif tag == 'groups': 17528 obj.groups = GroupReader.read_many(reader) 17529 elif tag == 'last_name': 17530 obj.last_name = Reader.read_string(reader) 17531 elif tag == 'logged_in': 17532 obj.logged_in = Reader.read_boolean(reader) 17533 elif tag == 'name': 17534 obj.name = Reader.read_string(reader) 17535 elif tag == 'namespace': 17536 obj.namespace = Reader.read_string(reader) 17537 elif tag == 'options': 17538 obj.options = UserOptionReader.read_many(reader) 17539 elif tag == 'password': 17540 obj.password = Reader.read_string(reader) 17541 elif tag == 'permissions': 17542 obj.permissions = PermissionReader.read_many(reader) 17543 elif tag == 'principal': 17544 obj.principal = Reader.read_string(reader) 17545 elif tag == 'roles': 17546 obj.roles = RoleReader.read_many(reader) 17547 elif tag == 'ssh_public_keys': 17548 obj.ssh_public_keys = SshPublicKeyReader.read_many(reader) 17549 elif tag == 'tags': 17550 obj.tags = TagReader.read_many(reader) 17551 elif tag == 'user_name': 17552 obj.user_name = Reader.read_string(reader) 17553 elif tag == 'user_options': 17554 obj.user_options = PropertyReader.read_many(reader) 17555 elif tag == 'link': 17556 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 17557 reader.next_element() 17558 else: 17559 reader.next_element() 17560 for link in links: 17561 UserReader._process_link(link, obj) 17562 17563 # Discard the end tag: 17564 reader.read() 17565 17566 return obj 17567 17568 @staticmethod 17569 def read_many(reader): 17570 # Do nothing if there aren't more tags: 17571 objs = List() 17572 if not reader.forward(): 17573 return objs 17574 17575 # Process the attributes: 17576 objs.href = reader.get_attribute('href') 17577 17578 # Discard the start tag: 17579 empty = reader.empty_element() 17580 reader.read() 17581 if empty: 17582 return objs 17583 17584 # Process the inner elements: 17585 while reader.forward(): 17586 objs.append(UserReader.read_one(reader)) 17587 17588 # Discard the end tag: 17589 reader.read() 17590 17591 return objs 17592 17593 @staticmethod 17594 def _process_link(link, obj): 17595 # Process the attributes: 17596 rel = link[0] 17597 href = link[1] 17598 if href and rel: 17599 if rel == "groups": 17600 if obj.groups is not None: 17601 obj.groups.href = href 17602 else: 17603 obj.groups = List(href) 17604 elif rel == "options": 17605 if obj.options is not None: 17606 obj.options.href = href 17607 else: 17608 obj.options = List(href) 17609 elif rel == "permissions": 17610 if obj.permissions is not None: 17611 obj.permissions.href = href 17612 else: 17613 obj.permissions = List(href) 17614 elif rel == "roles": 17615 if obj.roles is not None: 17616 obj.roles.href = href 17617 else: 17618 obj.roles = List(href) 17619 elif rel == "sshpublickeys": 17620 if obj.ssh_public_keys is not None: 17621 obj.ssh_public_keys.href = href 17622 else: 17623 obj.ssh_public_keys = List(href) 17624 elif rel == "tags": 17625 if obj.tags is not None: 17626 obj.tags.href = href 17627 else: 17628 obj.tags = List(href) 17629 17630 17631class UserOptionReader(Reader): 17632 17633 def __init__(self): 17634 super(UserOptionReader, self).__init__() 17635 17636 @staticmethod 17637 def read_one(reader): 17638 # Do nothing if there aren't more tags: 17639 if not reader.forward(): 17640 return None 17641 17642 # Create the object: 17643 obj = types.UserOption() 17644 17645 # Process the attributes: 17646 obj.href = reader.get_attribute('href') 17647 value = reader.get_attribute('id') 17648 if value is not None: 17649 obj.id = value 17650 17651 # Discard the start tag: 17652 empty = reader.empty_element() 17653 reader.read() 17654 if empty: 17655 return obj 17656 17657 # Process the inner elements: 17658 links = [] 17659 while reader.forward(): 17660 tag = reader.node_name() 17661 if tag == 'comment': 17662 obj.comment = Reader.read_string(reader) 17663 elif tag == 'content': 17664 obj.content = Reader.read_string(reader) 17665 elif tag == 'description': 17666 obj.description = Reader.read_string(reader) 17667 elif tag == 'name': 17668 obj.name = Reader.read_string(reader) 17669 elif tag == 'user': 17670 obj.user = UserReader.read_one(reader) 17671 else: 17672 reader.next_element() 17673 for link in links: 17674 UserOptionReader._process_link(link, obj) 17675 17676 # Discard the end tag: 17677 reader.read() 17678 17679 return obj 17680 17681 @staticmethod 17682 def read_many(reader): 17683 # Do nothing if there aren't more tags: 17684 objs = List() 17685 if not reader.forward(): 17686 return objs 17687 17688 # Process the attributes: 17689 objs.href = reader.get_attribute('href') 17690 17691 # Discard the start tag: 17692 empty = reader.empty_element() 17693 reader.read() 17694 if empty: 17695 return objs 17696 17697 # Process the inner elements: 17698 while reader.forward(): 17699 objs.append(UserOptionReader.read_one(reader)) 17700 17701 # Discard the end tag: 17702 reader.read() 17703 17704 return objs 17705 17706 17707class ValueReader(Reader): 17708 17709 def __init__(self): 17710 super(ValueReader, self).__init__() 17711 17712 @staticmethod 17713 def read_one(reader): 17714 # Do nothing if there aren't more tags: 17715 if not reader.forward(): 17716 return None 17717 17718 # Create the object: 17719 obj = types.Value() 17720 17721 # Process the attributes: 17722 obj.href = reader.get_attribute('href') 17723 17724 # Discard the start tag: 17725 empty = reader.empty_element() 17726 reader.read() 17727 if empty: 17728 return obj 17729 17730 # Process the inner elements: 17731 links = [] 17732 while reader.forward(): 17733 tag = reader.node_name() 17734 if tag == 'datum': 17735 obj.datum = Reader.read_decimal(reader) 17736 elif tag == 'detail': 17737 obj.detail = Reader.read_string(reader) 17738 else: 17739 reader.next_element() 17740 for link in links: 17741 ValueReader._process_link(link, obj) 17742 17743 # Discard the end tag: 17744 reader.read() 17745 17746 return obj 17747 17748 @staticmethod 17749 def read_many(reader): 17750 # Do nothing if there aren't more tags: 17751 objs = List() 17752 if not reader.forward(): 17753 return objs 17754 17755 # Process the attributes: 17756 objs.href = reader.get_attribute('href') 17757 17758 # Discard the start tag: 17759 empty = reader.empty_element() 17760 reader.read() 17761 if empty: 17762 return objs 17763 17764 # Process the inner elements: 17765 while reader.forward(): 17766 objs.append(ValueReader.read_one(reader)) 17767 17768 # Discard the end tag: 17769 reader.read() 17770 17771 return objs 17772 17773 17774class VcpuPinReader(Reader): 17775 17776 def __init__(self): 17777 super(VcpuPinReader, self).__init__() 17778 17779 @staticmethod 17780 def read_one(reader): 17781 # Do nothing if there aren't more tags: 17782 if not reader.forward(): 17783 return None 17784 17785 # Create the object: 17786 obj = types.VcpuPin() 17787 17788 # Process the attributes: 17789 obj.href = reader.get_attribute('href') 17790 17791 # Discard the start tag: 17792 empty = reader.empty_element() 17793 reader.read() 17794 if empty: 17795 return obj 17796 17797 # Process the inner elements: 17798 links = [] 17799 while reader.forward(): 17800 tag = reader.node_name() 17801 if tag == 'cpu_set': 17802 obj.cpu_set = Reader.read_string(reader) 17803 elif tag == 'vcpu': 17804 obj.vcpu = Reader.read_integer(reader) 17805 else: 17806 reader.next_element() 17807 for link in links: 17808 VcpuPinReader._process_link(link, obj) 17809 17810 # Discard the end tag: 17811 reader.read() 17812 17813 return obj 17814 17815 @staticmethod 17816 def read_many(reader): 17817 # Do nothing if there aren't more tags: 17818 objs = List() 17819 if not reader.forward(): 17820 return objs 17821 17822 # Process the attributes: 17823 objs.href = reader.get_attribute('href') 17824 17825 # Discard the start tag: 17826 empty = reader.empty_element() 17827 reader.read() 17828 if empty: 17829 return objs 17830 17831 # Process the inner elements: 17832 while reader.forward(): 17833 objs.append(VcpuPinReader.read_one(reader)) 17834 17835 # Discard the end tag: 17836 reader.read() 17837 17838 return objs 17839 17840 17841class VendorReader(Reader): 17842 17843 def __init__(self): 17844 super(VendorReader, self).__init__() 17845 17846 @staticmethod 17847 def read_one(reader): 17848 # Do nothing if there aren't more tags: 17849 if not reader.forward(): 17850 return None 17851 17852 # Create the object: 17853 obj = types.Vendor() 17854 17855 # Process the attributes: 17856 obj.href = reader.get_attribute('href') 17857 value = reader.get_attribute('id') 17858 if value is not None: 17859 obj.id = value 17860 17861 # Discard the start tag: 17862 empty = reader.empty_element() 17863 reader.read() 17864 if empty: 17865 return obj 17866 17867 # Process the inner elements: 17868 links = [] 17869 while reader.forward(): 17870 tag = reader.node_name() 17871 if tag == 'comment': 17872 obj.comment = Reader.read_string(reader) 17873 elif tag == 'description': 17874 obj.description = Reader.read_string(reader) 17875 elif tag == 'name': 17876 obj.name = Reader.read_string(reader) 17877 else: 17878 reader.next_element() 17879 for link in links: 17880 VendorReader._process_link(link, obj) 17881 17882 # Discard the end tag: 17883 reader.read() 17884 17885 return obj 17886 17887 @staticmethod 17888 def read_many(reader): 17889 # Do nothing if there aren't more tags: 17890 objs = List() 17891 if not reader.forward(): 17892 return objs 17893 17894 # Process the attributes: 17895 objs.href = reader.get_attribute('href') 17896 17897 # Discard the start tag: 17898 empty = reader.empty_element() 17899 reader.read() 17900 if empty: 17901 return objs 17902 17903 # Process the inner elements: 17904 while reader.forward(): 17905 objs.append(VendorReader.read_one(reader)) 17906 17907 # Discard the end tag: 17908 reader.read() 17909 17910 return objs 17911 17912 17913class VersionReader(Reader): 17914 17915 def __init__(self): 17916 super(VersionReader, self).__init__() 17917 17918 @staticmethod 17919 def read_one(reader): 17920 # Do nothing if there aren't more tags: 17921 if not reader.forward(): 17922 return None 17923 17924 # Create the object: 17925 obj = types.Version() 17926 17927 # Process the attributes: 17928 obj.href = reader.get_attribute('href') 17929 value = reader.get_attribute('id') 17930 if value is not None: 17931 obj.id = value 17932 17933 # Discard the start tag: 17934 empty = reader.empty_element() 17935 reader.read() 17936 if empty: 17937 return obj 17938 17939 # Process the inner elements: 17940 links = [] 17941 while reader.forward(): 17942 tag = reader.node_name() 17943 if tag == 'build': 17944 obj.build = Reader.read_integer(reader) 17945 elif tag == 'comment': 17946 obj.comment = Reader.read_string(reader) 17947 elif tag == 'description': 17948 obj.description = Reader.read_string(reader) 17949 elif tag == 'full_version': 17950 obj.full_version = Reader.read_string(reader) 17951 elif tag == 'major': 17952 obj.major = Reader.read_integer(reader) 17953 elif tag == 'minor': 17954 obj.minor = Reader.read_integer(reader) 17955 elif tag == 'name': 17956 obj.name = Reader.read_string(reader) 17957 elif tag == 'revision': 17958 obj.revision = Reader.read_integer(reader) 17959 else: 17960 reader.next_element() 17961 for link in links: 17962 VersionReader._process_link(link, obj) 17963 17964 # Discard the end tag: 17965 reader.read() 17966 17967 return obj 17968 17969 @staticmethod 17970 def read_many(reader): 17971 # Do nothing if there aren't more tags: 17972 objs = List() 17973 if not reader.forward(): 17974 return objs 17975 17976 # Process the attributes: 17977 objs.href = reader.get_attribute('href') 17978 17979 # Discard the start tag: 17980 empty = reader.empty_element() 17981 reader.read() 17982 if empty: 17983 return objs 17984 17985 # Process the inner elements: 17986 while reader.forward(): 17987 objs.append(VersionReader.read_one(reader)) 17988 17989 # Discard the end tag: 17990 reader.read() 17991 17992 return objs 17993 17994 17995class VirtioScsiReader(Reader): 17996 17997 def __init__(self): 17998 super(VirtioScsiReader, self).__init__() 17999 18000 @staticmethod 18001 def read_one(reader): 18002 # Do nothing if there aren't more tags: 18003 if not reader.forward(): 18004 return None 18005 18006 # Create the object: 18007 obj = types.VirtioScsi() 18008 18009 # Process the attributes: 18010 obj.href = reader.get_attribute('href') 18011 18012 # Discard the start tag: 18013 empty = reader.empty_element() 18014 reader.read() 18015 if empty: 18016 return obj 18017 18018 # Process the inner elements: 18019 links = [] 18020 while reader.forward(): 18021 tag = reader.node_name() 18022 if tag == 'enabled': 18023 obj.enabled = Reader.read_boolean(reader) 18024 else: 18025 reader.next_element() 18026 for link in links: 18027 VirtioScsiReader._process_link(link, obj) 18028 18029 # Discard the end tag: 18030 reader.read() 18031 18032 return obj 18033 18034 @staticmethod 18035 def read_many(reader): 18036 # Do nothing if there aren't more tags: 18037 objs = List() 18038 if not reader.forward(): 18039 return objs 18040 18041 # Process the attributes: 18042 objs.href = reader.get_attribute('href') 18043 18044 # Discard the start tag: 18045 empty = reader.empty_element() 18046 reader.read() 18047 if empty: 18048 return objs 18049 18050 # Process the inner elements: 18051 while reader.forward(): 18052 objs.append(VirtioScsiReader.read_one(reader)) 18053 18054 # Discard the end tag: 18055 reader.read() 18056 18057 return objs 18058 18059 18060class VirtualNumaNodeReader(Reader): 18061 18062 def __init__(self): 18063 super(VirtualNumaNodeReader, self).__init__() 18064 18065 @staticmethod 18066 def read_one(reader): 18067 # Do nothing if there aren't more tags: 18068 if not reader.forward(): 18069 return None 18070 18071 # Create the object: 18072 obj = types.VirtualNumaNode() 18073 18074 # Process the attributes: 18075 obj.href = reader.get_attribute('href') 18076 value = reader.get_attribute('id') 18077 if value is not None: 18078 obj.id = value 18079 18080 # Discard the start tag: 18081 empty = reader.empty_element() 18082 reader.read() 18083 if empty: 18084 return obj 18085 18086 # Process the inner elements: 18087 links = [] 18088 while reader.forward(): 18089 tag = reader.node_name() 18090 if tag == 'comment': 18091 obj.comment = Reader.read_string(reader) 18092 elif tag == 'cpu': 18093 obj.cpu = CpuReader.read_one(reader) 18094 elif tag == 'description': 18095 obj.description = Reader.read_string(reader) 18096 elif tag == 'host': 18097 obj.host = HostReader.read_one(reader) 18098 elif tag == 'index': 18099 obj.index = Reader.read_integer(reader) 18100 elif tag == 'memory': 18101 obj.memory = Reader.read_integer(reader) 18102 elif tag == 'name': 18103 obj.name = Reader.read_string(reader) 18104 elif tag == 'node_distance': 18105 obj.node_distance = Reader.read_string(reader) 18106 elif tag == 'numa_node_pins': 18107 obj.numa_node_pins = NumaNodePinReader.read_many(reader) 18108 elif tag == 'numa_tune_mode': 18109 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18110 elif tag == 'statistics': 18111 obj.statistics = StatisticReader.read_many(reader) 18112 elif tag == 'vm': 18113 obj.vm = VmReader.read_one(reader) 18114 elif tag == 'link': 18115 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18116 reader.next_element() 18117 else: 18118 reader.next_element() 18119 for link in links: 18120 VirtualNumaNodeReader._process_link(link, obj) 18121 18122 # Discard the end tag: 18123 reader.read() 18124 18125 return obj 18126 18127 @staticmethod 18128 def read_many(reader): 18129 # Do nothing if there aren't more tags: 18130 objs = List() 18131 if not reader.forward(): 18132 return objs 18133 18134 # Process the attributes: 18135 objs.href = reader.get_attribute('href') 18136 18137 # Discard the start tag: 18138 empty = reader.empty_element() 18139 reader.read() 18140 if empty: 18141 return objs 18142 18143 # Process the inner elements: 18144 while reader.forward(): 18145 objs.append(VirtualNumaNodeReader.read_one(reader)) 18146 18147 # Discard the end tag: 18148 reader.read() 18149 18150 return objs 18151 18152 @staticmethod 18153 def _process_link(link, obj): 18154 # Process the attributes: 18155 rel = link[0] 18156 href = link[1] 18157 if href and rel: 18158 if rel == "statistics": 18159 if obj.statistics is not None: 18160 obj.statistics.href = href 18161 else: 18162 obj.statistics = List(href) 18163 18164 18165class VlanReader(Reader): 18166 18167 def __init__(self): 18168 super(VlanReader, self).__init__() 18169 18170 @staticmethod 18171 def read_one(reader): 18172 # Do nothing if there aren't more tags: 18173 if not reader.forward(): 18174 return None 18175 18176 # Create the object: 18177 obj = types.Vlan() 18178 18179 # Process the attributes: 18180 obj.href = reader.get_attribute('href') 18181 value = reader.get_attribute('id') 18182 if value is not None: 18183 obj.id = Reader.parse_integer(value) 18184 18185 # Discard the start tag: 18186 empty = reader.empty_element() 18187 reader.read() 18188 if empty: 18189 return obj 18190 18191 # Process the inner elements: 18192 reader.next_element() 18193 18194 # Discard the end tag: 18195 reader.read() 18196 18197 return obj 18198 18199 @staticmethod 18200 def read_many(reader): 18201 # Do nothing if there aren't more tags: 18202 objs = List() 18203 if not reader.forward(): 18204 return objs 18205 18206 # Process the attributes: 18207 objs.href = reader.get_attribute('href') 18208 18209 # Discard the start tag: 18210 empty = reader.empty_element() 18211 reader.read() 18212 if empty: 18213 return objs 18214 18215 # Process the inner elements: 18216 while reader.forward(): 18217 objs.append(VlanReader.read_one(reader)) 18218 18219 # Discard the end tag: 18220 reader.read() 18221 18222 return objs 18223 18224 18225class VmReader(Reader): 18226 18227 def __init__(self): 18228 super(VmReader, self).__init__() 18229 18230 @staticmethod 18231 def read_one(reader): 18232 # Do nothing if there aren't more tags: 18233 if not reader.forward(): 18234 return None 18235 18236 # Create the object: 18237 obj = types.Vm() 18238 18239 # Process the attributes: 18240 obj.href = reader.get_attribute('href') 18241 value = reader.get_attribute('id') 18242 if value is not None: 18243 obj.id = value 18244 18245 # Discard the start tag: 18246 empty = reader.empty_element() 18247 reader.read() 18248 if empty: 18249 return obj 18250 18251 # Process the inner elements: 18252 links = [] 18253 while reader.forward(): 18254 tag = reader.node_name() 18255 if tag == 'affinity_labels': 18256 obj.affinity_labels = AffinityLabelReader.read_many(reader) 18257 elif tag == 'applications': 18258 obj.applications = ApplicationReader.read_many(reader) 18259 elif tag == 'auto_pinning_policy': 18260 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18261 elif tag == 'bios': 18262 obj.bios = BiosReader.read_one(reader) 18263 elif tag == 'cdroms': 18264 obj.cdroms = CdromReader.read_many(reader) 18265 elif tag == 'cluster': 18266 obj.cluster = ClusterReader.read_one(reader) 18267 elif tag == 'comment': 18268 obj.comment = Reader.read_string(reader) 18269 elif tag == 'console': 18270 obj.console = ConsoleReader.read_one(reader) 18271 elif tag == 'cpu': 18272 obj.cpu = CpuReader.read_one(reader) 18273 elif tag == 'cpu_pinning_policy': 18274 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18275 elif tag == 'cpu_profile': 18276 obj.cpu_profile = CpuProfileReader.read_one(reader) 18277 elif tag == 'cpu_shares': 18278 obj.cpu_shares = Reader.read_integer(reader) 18279 elif tag == 'creation_time': 18280 obj.creation_time = Reader.read_date(reader) 18281 elif tag == 'custom_compatibility_version': 18282 obj.custom_compatibility_version = VersionReader.read_one(reader) 18283 elif tag == 'custom_cpu_model': 18284 obj.custom_cpu_model = Reader.read_string(reader) 18285 elif tag == 'custom_emulated_machine': 18286 obj.custom_emulated_machine = Reader.read_string(reader) 18287 elif tag == 'custom_properties': 18288 obj.custom_properties = CustomPropertyReader.read_many(reader) 18289 elif tag == 'delete_protected': 18290 obj.delete_protected = Reader.read_boolean(reader) 18291 elif tag == 'description': 18292 obj.description = Reader.read_string(reader) 18293 elif tag == 'disk_attachments': 18294 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 18295 elif tag == 'display': 18296 obj.display = DisplayReader.read_one(reader) 18297 elif tag == 'domain': 18298 obj.domain = DomainReader.read_one(reader) 18299 elif tag == 'dynamic_cpu': 18300 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 18301 elif tag == 'external_host_provider': 18302 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 18303 elif tag == 'floppies': 18304 obj.floppies = FloppyReader.read_many(reader) 18305 elif tag == 'fqdn': 18306 obj.fqdn = Reader.read_string(reader) 18307 elif tag == 'graphics_consoles': 18308 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 18309 elif tag == 'guest_operating_system': 18310 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 18311 elif tag == 'guest_time_zone': 18312 obj.guest_time_zone = TimeZoneReader.read_one(reader) 18313 elif tag == 'has_illegal_images': 18314 obj.has_illegal_images = Reader.read_boolean(reader) 18315 elif tag == 'high_availability': 18316 obj.high_availability = HighAvailabilityReader.read_one(reader) 18317 elif tag == 'host': 18318 obj.host = HostReader.read_one(reader) 18319 elif tag == 'host_devices': 18320 obj.host_devices = HostDeviceReader.read_many(reader) 18321 elif tag == 'initialization': 18322 obj.initialization = InitializationReader.read_one(reader) 18323 elif tag == 'instance_type': 18324 obj.instance_type = InstanceTypeReader.read_one(reader) 18325 elif tag == 'io': 18326 obj.io = IoReader.read_one(reader) 18327 elif tag == 'katello_errata': 18328 obj.katello_errata = KatelloErratumReader.read_many(reader) 18329 elif tag == 'large_icon': 18330 obj.large_icon = IconReader.read_one(reader) 18331 elif tag == 'lease': 18332 obj.lease = StorageDomainLeaseReader.read_one(reader) 18333 elif tag == 'mediated_devices': 18334 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 18335 elif tag == 'memory': 18336 obj.memory = Reader.read_integer(reader) 18337 elif tag == 'memory_policy': 18338 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18339 elif tag == 'migration': 18340 obj.migration = MigrationOptionsReader.read_one(reader) 18341 elif tag == 'migration_downtime': 18342 obj.migration_downtime = Reader.read_integer(reader) 18343 elif tag == 'multi_queues_enabled': 18344 obj.multi_queues_enabled = Reader.read_boolean(reader) 18345 elif tag == 'name': 18346 obj.name = Reader.read_string(reader) 18347 elif tag == 'next_run_configuration_exists': 18348 obj.next_run_configuration_exists = Reader.read_boolean(reader) 18349 elif tag == 'nics': 18350 obj.nics = NicReader.read_many(reader) 18351 elif tag == 'host_numa_nodes': 18352 obj.numa_nodes = NumaNodeReader.read_many(reader) 18353 elif tag == 'numa_tune_mode': 18354 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18355 elif tag == 'origin': 18356 obj.origin = Reader.read_string(reader) 18357 elif tag == 'original_template': 18358 obj.original_template = TemplateReader.read_one(reader) 18359 elif tag == 'os': 18360 obj.os = OperatingSystemReader.read_one(reader) 18361 elif tag == 'payloads': 18362 obj.payloads = PayloadReader.read_many(reader) 18363 elif tag == 'permissions': 18364 obj.permissions = PermissionReader.read_many(reader) 18365 elif tag == 'placement_policy': 18366 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18367 elif tag == 'quota': 18368 obj.quota = QuotaReader.read_one(reader) 18369 elif tag == 'reported_devices': 18370 obj.reported_devices = ReportedDeviceReader.read_many(reader) 18371 elif tag == 'rng_device': 18372 obj.rng_device = RngDeviceReader.read_one(reader) 18373 elif tag == 'run_once': 18374 obj.run_once = Reader.read_boolean(reader) 18375 elif tag == 'serial_number': 18376 obj.serial_number = SerialNumberReader.read_one(reader) 18377 elif tag == 'sessions': 18378 obj.sessions = SessionReader.read_many(reader) 18379 elif tag == 'small_icon': 18380 obj.small_icon = IconReader.read_one(reader) 18381 elif tag == 'snapshots': 18382 obj.snapshots = SnapshotReader.read_many(reader) 18383 elif tag == 'soundcard_enabled': 18384 obj.soundcard_enabled = Reader.read_boolean(reader) 18385 elif tag == 'sso': 18386 obj.sso = SsoReader.read_one(reader) 18387 elif tag == 'start_paused': 18388 obj.start_paused = Reader.read_boolean(reader) 18389 elif tag == 'start_time': 18390 obj.start_time = Reader.read_date(reader) 18391 elif tag == 'stateless': 18392 obj.stateless = Reader.read_boolean(reader) 18393 elif tag == 'statistics': 18394 obj.statistics = StatisticReader.read_many(reader) 18395 elif tag == 'status': 18396 obj.status = Reader.read_enum(types.VmStatus, reader) 18397 elif tag == 'status_detail': 18398 obj.status_detail = Reader.read_string(reader) 18399 elif tag == 'stop_reason': 18400 obj.stop_reason = Reader.read_string(reader) 18401 elif tag == 'stop_time': 18402 obj.stop_time = Reader.read_date(reader) 18403 elif tag == 'storage_domain': 18404 obj.storage_domain = StorageDomainReader.read_one(reader) 18405 elif tag == 'storage_error_resume_behaviour': 18406 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18407 elif tag == 'tags': 18408 obj.tags = TagReader.read_many(reader) 18409 elif tag == 'template': 18410 obj.template = TemplateReader.read_one(reader) 18411 elif tag == 'time_zone': 18412 obj.time_zone = TimeZoneReader.read_one(reader) 18413 elif tag == 'tpm_enabled': 18414 obj.tpm_enabled = Reader.read_boolean(reader) 18415 elif tag == 'tunnel_migration': 18416 obj.tunnel_migration = Reader.read_boolean(reader) 18417 elif tag == 'type': 18418 obj.type = Reader.read_enum(types.VmType, reader) 18419 elif tag == 'usb': 18420 obj.usb = UsbReader.read_one(reader) 18421 elif tag == 'use_latest_template_version': 18422 obj.use_latest_template_version = Reader.read_boolean(reader) 18423 elif tag == 'virtio_scsi': 18424 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18425 elif tag == 'virtio_scsi_multi_queues': 18426 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18427 elif tag == 'virtio_scsi_multi_queues_enabled': 18428 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18429 elif tag == 'vm_pool': 18430 obj.vm_pool = VmPoolReader.read_one(reader) 18431 elif tag == 'watchdogs': 18432 obj.watchdogs = WatchdogReader.read_many(reader) 18433 elif tag == 'link': 18434 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18435 reader.next_element() 18436 else: 18437 reader.next_element() 18438 for link in links: 18439 VmReader._process_link(link, obj) 18440 18441 # Discard the end tag: 18442 reader.read() 18443 18444 return obj 18445 18446 @staticmethod 18447 def read_many(reader): 18448 # Do nothing if there aren't more tags: 18449 objs = List() 18450 if not reader.forward(): 18451 return objs 18452 18453 # Process the attributes: 18454 objs.href = reader.get_attribute('href') 18455 18456 # Discard the start tag: 18457 empty = reader.empty_element() 18458 reader.read() 18459 if empty: 18460 return objs 18461 18462 # Process the inner elements: 18463 while reader.forward(): 18464 objs.append(VmReader.read_one(reader)) 18465 18466 # Discard the end tag: 18467 reader.read() 18468 18469 return objs 18470 18471 @staticmethod 18472 def _process_link(link, obj): 18473 # Process the attributes: 18474 rel = link[0] 18475 href = link[1] 18476 if href and rel: 18477 if rel == "affinitylabels": 18478 if obj.affinity_labels is not None: 18479 obj.affinity_labels.href = href 18480 else: 18481 obj.affinity_labels = List(href) 18482 elif rel == "applications": 18483 if obj.applications is not None: 18484 obj.applications.href = href 18485 else: 18486 obj.applications = List(href) 18487 elif rel == "cdroms": 18488 if obj.cdroms is not None: 18489 obj.cdroms.href = href 18490 else: 18491 obj.cdroms = List(href) 18492 elif rel == "diskattachments": 18493 if obj.disk_attachments is not None: 18494 obj.disk_attachments.href = href 18495 else: 18496 obj.disk_attachments = List(href) 18497 elif rel == "floppies": 18498 if obj.floppies is not None: 18499 obj.floppies.href = href 18500 else: 18501 obj.floppies = List(href) 18502 elif rel == "graphicsconsoles": 18503 if obj.graphics_consoles is not None: 18504 obj.graphics_consoles.href = href 18505 else: 18506 obj.graphics_consoles = List(href) 18507 elif rel == "hostdevices": 18508 if obj.host_devices is not None: 18509 obj.host_devices.href = href 18510 else: 18511 obj.host_devices = List(href) 18512 elif rel == "katelloerrata": 18513 if obj.katello_errata is not None: 18514 obj.katello_errata.href = href 18515 else: 18516 obj.katello_errata = List(href) 18517 elif rel == "mediateddevices": 18518 if obj.mediated_devices is not None: 18519 obj.mediated_devices.href = href 18520 else: 18521 obj.mediated_devices = List(href) 18522 elif rel == "nics": 18523 if obj.nics is not None: 18524 obj.nics.href = href 18525 else: 18526 obj.nics = List(href) 18527 elif rel == "numanodes": 18528 if obj.numa_nodes is not None: 18529 obj.numa_nodes.href = href 18530 else: 18531 obj.numa_nodes = List(href) 18532 elif rel == "permissions": 18533 if obj.permissions is not None: 18534 obj.permissions.href = href 18535 else: 18536 obj.permissions = List(href) 18537 elif rel == "reporteddevices": 18538 if obj.reported_devices is not None: 18539 obj.reported_devices.href = href 18540 else: 18541 obj.reported_devices = List(href) 18542 elif rel == "sessions": 18543 if obj.sessions is not None: 18544 obj.sessions.href = href 18545 else: 18546 obj.sessions = List(href) 18547 elif rel == "snapshots": 18548 if obj.snapshots is not None: 18549 obj.snapshots.href = href 18550 else: 18551 obj.snapshots = List(href) 18552 elif rel == "statistics": 18553 if obj.statistics is not None: 18554 obj.statistics.href = href 18555 else: 18556 obj.statistics = List(href) 18557 elif rel == "tags": 18558 if obj.tags is not None: 18559 obj.tags.href = href 18560 else: 18561 obj.tags = List(href) 18562 elif rel == "watchdogs": 18563 if obj.watchdogs is not None: 18564 obj.watchdogs.href = href 18565 else: 18566 obj.watchdogs = List(href) 18567 18568 18569class VmBaseReader(Reader): 18570 18571 def __init__(self): 18572 super(VmBaseReader, self).__init__() 18573 18574 @staticmethod 18575 def read_one(reader): 18576 # Do nothing if there aren't more tags: 18577 if not reader.forward(): 18578 return None 18579 18580 # Create the object: 18581 obj = types.VmBase() 18582 18583 # Process the attributes: 18584 obj.href = reader.get_attribute('href') 18585 value = reader.get_attribute('id') 18586 if value is not None: 18587 obj.id = value 18588 18589 # Discard the start tag: 18590 empty = reader.empty_element() 18591 reader.read() 18592 if empty: 18593 return obj 18594 18595 # Process the inner elements: 18596 links = [] 18597 while reader.forward(): 18598 tag = reader.node_name() 18599 if tag == 'auto_pinning_policy': 18600 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18601 elif tag == 'bios': 18602 obj.bios = BiosReader.read_one(reader) 18603 elif tag == 'cluster': 18604 obj.cluster = ClusterReader.read_one(reader) 18605 elif tag == 'comment': 18606 obj.comment = Reader.read_string(reader) 18607 elif tag == 'console': 18608 obj.console = ConsoleReader.read_one(reader) 18609 elif tag == 'cpu': 18610 obj.cpu = CpuReader.read_one(reader) 18611 elif tag == 'cpu_pinning_policy': 18612 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18613 elif tag == 'cpu_profile': 18614 obj.cpu_profile = CpuProfileReader.read_one(reader) 18615 elif tag == 'cpu_shares': 18616 obj.cpu_shares = Reader.read_integer(reader) 18617 elif tag == 'creation_time': 18618 obj.creation_time = Reader.read_date(reader) 18619 elif tag == 'custom_compatibility_version': 18620 obj.custom_compatibility_version = VersionReader.read_one(reader) 18621 elif tag == 'custom_cpu_model': 18622 obj.custom_cpu_model = Reader.read_string(reader) 18623 elif tag == 'custom_emulated_machine': 18624 obj.custom_emulated_machine = Reader.read_string(reader) 18625 elif tag == 'custom_properties': 18626 obj.custom_properties = CustomPropertyReader.read_many(reader) 18627 elif tag == 'delete_protected': 18628 obj.delete_protected = Reader.read_boolean(reader) 18629 elif tag == 'description': 18630 obj.description = Reader.read_string(reader) 18631 elif tag == 'display': 18632 obj.display = DisplayReader.read_one(reader) 18633 elif tag == 'domain': 18634 obj.domain = DomainReader.read_one(reader) 18635 elif tag == 'high_availability': 18636 obj.high_availability = HighAvailabilityReader.read_one(reader) 18637 elif tag == 'initialization': 18638 obj.initialization = InitializationReader.read_one(reader) 18639 elif tag == 'io': 18640 obj.io = IoReader.read_one(reader) 18641 elif tag == 'large_icon': 18642 obj.large_icon = IconReader.read_one(reader) 18643 elif tag == 'lease': 18644 obj.lease = StorageDomainLeaseReader.read_one(reader) 18645 elif tag == 'memory': 18646 obj.memory = Reader.read_integer(reader) 18647 elif tag == 'memory_policy': 18648 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18649 elif tag == 'migration': 18650 obj.migration = MigrationOptionsReader.read_one(reader) 18651 elif tag == 'migration_downtime': 18652 obj.migration_downtime = Reader.read_integer(reader) 18653 elif tag == 'multi_queues_enabled': 18654 obj.multi_queues_enabled = Reader.read_boolean(reader) 18655 elif tag == 'name': 18656 obj.name = Reader.read_string(reader) 18657 elif tag == 'origin': 18658 obj.origin = Reader.read_string(reader) 18659 elif tag == 'os': 18660 obj.os = OperatingSystemReader.read_one(reader) 18661 elif tag == 'placement_policy': 18662 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18663 elif tag == 'quota': 18664 obj.quota = QuotaReader.read_one(reader) 18665 elif tag == 'rng_device': 18666 obj.rng_device = RngDeviceReader.read_one(reader) 18667 elif tag == 'serial_number': 18668 obj.serial_number = SerialNumberReader.read_one(reader) 18669 elif tag == 'small_icon': 18670 obj.small_icon = IconReader.read_one(reader) 18671 elif tag == 'soundcard_enabled': 18672 obj.soundcard_enabled = Reader.read_boolean(reader) 18673 elif tag == 'sso': 18674 obj.sso = SsoReader.read_one(reader) 18675 elif tag == 'start_paused': 18676 obj.start_paused = Reader.read_boolean(reader) 18677 elif tag == 'stateless': 18678 obj.stateless = Reader.read_boolean(reader) 18679 elif tag == 'storage_domain': 18680 obj.storage_domain = StorageDomainReader.read_one(reader) 18681 elif tag == 'storage_error_resume_behaviour': 18682 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18683 elif tag == 'time_zone': 18684 obj.time_zone = TimeZoneReader.read_one(reader) 18685 elif tag == 'tpm_enabled': 18686 obj.tpm_enabled = Reader.read_boolean(reader) 18687 elif tag == 'tunnel_migration': 18688 obj.tunnel_migration = Reader.read_boolean(reader) 18689 elif tag == 'type': 18690 obj.type = Reader.read_enum(types.VmType, reader) 18691 elif tag == 'usb': 18692 obj.usb = UsbReader.read_one(reader) 18693 elif tag == 'virtio_scsi': 18694 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18695 elif tag == 'virtio_scsi_multi_queues': 18696 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18697 elif tag == 'virtio_scsi_multi_queues_enabled': 18698 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18699 else: 18700 reader.next_element() 18701 for link in links: 18702 VmBaseReader._process_link(link, obj) 18703 18704 # Discard the end tag: 18705 reader.read() 18706 18707 return obj 18708 18709 @staticmethod 18710 def read_many(reader): 18711 # Do nothing if there aren't more tags: 18712 objs = List() 18713 if not reader.forward(): 18714 return objs 18715 18716 # Process the attributes: 18717 objs.href = reader.get_attribute('href') 18718 18719 # Discard the start tag: 18720 empty = reader.empty_element() 18721 reader.read() 18722 if empty: 18723 return objs 18724 18725 # Process the inner elements: 18726 while reader.forward(): 18727 objs.append(VmBaseReader.read_one(reader)) 18728 18729 # Discard the end tag: 18730 reader.read() 18731 18732 return objs 18733 18734 18735class VmMediatedDeviceReader(Reader): 18736 18737 def __init__(self): 18738 super(VmMediatedDeviceReader, self).__init__() 18739 18740 @staticmethod 18741 def read_one(reader): 18742 # Do nothing if there aren't more tags: 18743 if not reader.forward(): 18744 return None 18745 18746 # Create the object: 18747 obj = types.VmMediatedDevice() 18748 18749 # Process the attributes: 18750 obj.href = reader.get_attribute('href') 18751 value = reader.get_attribute('id') 18752 if value is not None: 18753 obj.id = value 18754 18755 # Discard the start tag: 18756 empty = reader.empty_element() 18757 reader.read() 18758 if empty: 18759 return obj 18760 18761 # Process the inner elements: 18762 links = [] 18763 while reader.forward(): 18764 tag = reader.node_name() 18765 if tag == 'comment': 18766 obj.comment = Reader.read_string(reader) 18767 elif tag == 'description': 18768 obj.description = Reader.read_string(reader) 18769 elif tag == 'instance_type': 18770 obj.instance_type = InstanceTypeReader.read_one(reader) 18771 elif tag == 'name': 18772 obj.name = Reader.read_string(reader) 18773 elif tag == 'spec_params': 18774 obj.spec_params = PropertyReader.read_many(reader) 18775 elif tag == 'template': 18776 obj.template = TemplateReader.read_one(reader) 18777 elif tag == 'vm': 18778 obj.vm = VmReader.read_one(reader) 18779 elif tag == 'vms': 18780 obj.vms = VmReader.read_many(reader) 18781 elif tag == 'link': 18782 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18783 reader.next_element() 18784 else: 18785 reader.next_element() 18786 for link in links: 18787 VmMediatedDeviceReader._process_link(link, obj) 18788 18789 # Discard the end tag: 18790 reader.read() 18791 18792 return obj 18793 18794 @staticmethod 18795 def read_many(reader): 18796 # Do nothing if there aren't more tags: 18797 objs = List() 18798 if not reader.forward(): 18799 return objs 18800 18801 # Process the attributes: 18802 objs.href = reader.get_attribute('href') 18803 18804 # Discard the start tag: 18805 empty = reader.empty_element() 18806 reader.read() 18807 if empty: 18808 return objs 18809 18810 # Process the inner elements: 18811 while reader.forward(): 18812 objs.append(VmMediatedDeviceReader.read_one(reader)) 18813 18814 # Discard the end tag: 18815 reader.read() 18816 18817 return objs 18818 18819 @staticmethod 18820 def _process_link(link, obj): 18821 # Process the attributes: 18822 rel = link[0] 18823 href = link[1] 18824 if href and rel: 18825 if rel == "vms": 18826 if obj.vms is not None: 18827 obj.vms.href = href 18828 else: 18829 obj.vms = List(href) 18830 18831 18832class VmPlacementPolicyReader(Reader): 18833 18834 def __init__(self): 18835 super(VmPlacementPolicyReader, self).__init__() 18836 18837 @staticmethod 18838 def read_one(reader): 18839 # Do nothing if there aren't more tags: 18840 if not reader.forward(): 18841 return None 18842 18843 # Create the object: 18844 obj = types.VmPlacementPolicy() 18845 18846 # Process the attributes: 18847 obj.href = reader.get_attribute('href') 18848 18849 # Discard the start tag: 18850 empty = reader.empty_element() 18851 reader.read() 18852 if empty: 18853 return obj 18854 18855 # Process the inner elements: 18856 links = [] 18857 while reader.forward(): 18858 tag = reader.node_name() 18859 if tag == 'affinity': 18860 obj.affinity = Reader.read_enum(types.VmAffinity, reader) 18861 elif tag == 'hosts': 18862 obj.hosts = HostReader.read_many(reader) 18863 elif tag == 'link': 18864 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18865 reader.next_element() 18866 else: 18867 reader.next_element() 18868 for link in links: 18869 VmPlacementPolicyReader._process_link(link, obj) 18870 18871 # Discard the end tag: 18872 reader.read() 18873 18874 return obj 18875 18876 @staticmethod 18877 def read_many(reader): 18878 # Do nothing if there aren't more tags: 18879 objs = List() 18880 if not reader.forward(): 18881 return objs 18882 18883 # Process the attributes: 18884 objs.href = reader.get_attribute('href') 18885 18886 # Discard the start tag: 18887 empty = reader.empty_element() 18888 reader.read() 18889 if empty: 18890 return objs 18891 18892 # Process the inner elements: 18893 while reader.forward(): 18894 objs.append(VmPlacementPolicyReader.read_one(reader)) 18895 18896 # Discard the end tag: 18897 reader.read() 18898 18899 return objs 18900 18901 @staticmethod 18902 def _process_link(link, obj): 18903 # Process the attributes: 18904 rel = link[0] 18905 href = link[1] 18906 if href and rel: 18907 if rel == "hosts": 18908 if obj.hosts is not None: 18909 obj.hosts.href = href 18910 else: 18911 obj.hosts = List(href) 18912 18913 18914class VmPoolReader(Reader): 18915 18916 def __init__(self): 18917 super(VmPoolReader, self).__init__() 18918 18919 @staticmethod 18920 def read_one(reader): 18921 # Do nothing if there aren't more tags: 18922 if not reader.forward(): 18923 return None 18924 18925 # Create the object: 18926 obj = types.VmPool() 18927 18928 # Process the attributes: 18929 obj.href = reader.get_attribute('href') 18930 value = reader.get_attribute('id') 18931 if value is not None: 18932 obj.id = value 18933 18934 # Discard the start tag: 18935 empty = reader.empty_element() 18936 reader.read() 18937 if empty: 18938 return obj 18939 18940 # Process the inner elements: 18941 links = [] 18942 while reader.forward(): 18943 tag = reader.node_name() 18944 if tag == 'auto_storage_select': 18945 obj.auto_storage_select = Reader.read_boolean(reader) 18946 elif tag == 'cluster': 18947 obj.cluster = ClusterReader.read_one(reader) 18948 elif tag == 'comment': 18949 obj.comment = Reader.read_string(reader) 18950 elif tag == 'description': 18951 obj.description = Reader.read_string(reader) 18952 elif tag == 'display': 18953 obj.display = DisplayReader.read_one(reader) 18954 elif tag == 'instance_type': 18955 obj.instance_type = InstanceTypeReader.read_one(reader) 18956 elif tag == 'max_user_vms': 18957 obj.max_user_vms = Reader.read_integer(reader) 18958 elif tag == 'name': 18959 obj.name = Reader.read_string(reader) 18960 elif tag == 'permissions': 18961 obj.permissions = PermissionReader.read_many(reader) 18962 elif tag == 'prestarted_vms': 18963 obj.prestarted_vms = Reader.read_integer(reader) 18964 elif tag == 'rng_device': 18965 obj.rng_device = RngDeviceReader.read_one(reader) 18966 elif tag == 'size': 18967 obj.size = Reader.read_integer(reader) 18968 elif tag == 'soundcard_enabled': 18969 obj.soundcard_enabled = Reader.read_boolean(reader) 18970 elif tag == 'stateful': 18971 obj.stateful = Reader.read_boolean(reader) 18972 elif tag == 'template': 18973 obj.template = TemplateReader.read_one(reader) 18974 elif tag == 'tpm_enabled': 18975 obj.tpm_enabled = Reader.read_boolean(reader) 18976 elif tag == 'type': 18977 obj.type = Reader.read_enum(types.VmPoolType, reader) 18978 elif tag == 'use_latest_template_version': 18979 obj.use_latest_template_version = Reader.read_boolean(reader) 18980 elif tag == 'vm': 18981 obj.vm = VmReader.read_one(reader) 18982 elif tag == 'link': 18983 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18984 reader.next_element() 18985 else: 18986 reader.next_element() 18987 for link in links: 18988 VmPoolReader._process_link(link, obj) 18989 18990 # Discard the end tag: 18991 reader.read() 18992 18993 return obj 18994 18995 @staticmethod 18996 def read_many(reader): 18997 # Do nothing if there aren't more tags: 18998 objs = List() 18999 if not reader.forward(): 19000 return objs 19001 19002 # Process the attributes: 19003 objs.href = reader.get_attribute('href') 19004 19005 # Discard the start tag: 19006 empty = reader.empty_element() 19007 reader.read() 19008 if empty: 19009 return objs 19010 19011 # Process the inner elements: 19012 while reader.forward(): 19013 objs.append(VmPoolReader.read_one(reader)) 19014 19015 # Discard the end tag: 19016 reader.read() 19017 19018 return objs 19019 19020 @staticmethod 19021 def _process_link(link, obj): 19022 # Process the attributes: 19023 rel = link[0] 19024 href = link[1] 19025 if href and rel: 19026 if rel == "permissions": 19027 if obj.permissions is not None: 19028 obj.permissions.href = href 19029 else: 19030 obj.permissions = List(href) 19031 19032 19033class VmSummaryReader(Reader): 19034 19035 def __init__(self): 19036 super(VmSummaryReader, self).__init__() 19037 19038 @staticmethod 19039 def read_one(reader): 19040 # Do nothing if there aren't more tags: 19041 if not reader.forward(): 19042 return None 19043 19044 # Create the object: 19045 obj = types.VmSummary() 19046 19047 # Process the attributes: 19048 obj.href = reader.get_attribute('href') 19049 19050 # Discard the start tag: 19051 empty = reader.empty_element() 19052 reader.read() 19053 if empty: 19054 return obj 19055 19056 # Process the inner elements: 19057 links = [] 19058 while reader.forward(): 19059 tag = reader.node_name() 19060 if tag == 'active': 19061 obj.active = Reader.read_integer(reader) 19062 elif tag == 'migrating': 19063 obj.migrating = Reader.read_integer(reader) 19064 elif tag == 'total': 19065 obj.total = Reader.read_integer(reader) 19066 else: 19067 reader.next_element() 19068 for link in links: 19069 VmSummaryReader._process_link(link, obj) 19070 19071 # Discard the end tag: 19072 reader.read() 19073 19074 return obj 19075 19076 @staticmethod 19077 def read_many(reader): 19078 # Do nothing if there aren't more tags: 19079 objs = List() 19080 if not reader.forward(): 19081 return objs 19082 19083 # Process the attributes: 19084 objs.href = reader.get_attribute('href') 19085 19086 # Discard the start tag: 19087 empty = reader.empty_element() 19088 reader.read() 19089 if empty: 19090 return objs 19091 19092 # Process the inner elements: 19093 while reader.forward(): 19094 objs.append(VmSummaryReader.read_one(reader)) 19095 19096 # Discard the end tag: 19097 reader.read() 19098 19099 return objs 19100 19101 19102class VnicPassThroughReader(Reader): 19103 19104 def __init__(self): 19105 super(VnicPassThroughReader, self).__init__() 19106 19107 @staticmethod 19108 def read_one(reader): 19109 # Do nothing if there aren't more tags: 19110 if not reader.forward(): 19111 return None 19112 19113 # Create the object: 19114 obj = types.VnicPassThrough() 19115 19116 # Process the attributes: 19117 obj.href = reader.get_attribute('href') 19118 19119 # Discard the start tag: 19120 empty = reader.empty_element() 19121 reader.read() 19122 if empty: 19123 return obj 19124 19125 # Process the inner elements: 19126 links = [] 19127 while reader.forward(): 19128 tag = reader.node_name() 19129 if tag == 'mode': 19130 obj.mode = Reader.read_enum(types.VnicPassThroughMode, reader) 19131 else: 19132 reader.next_element() 19133 for link in links: 19134 VnicPassThroughReader._process_link(link, obj) 19135 19136 # Discard the end tag: 19137 reader.read() 19138 19139 return obj 19140 19141 @staticmethod 19142 def read_many(reader): 19143 # Do nothing if there aren't more tags: 19144 objs = List() 19145 if not reader.forward(): 19146 return objs 19147 19148 # Process the attributes: 19149 objs.href = reader.get_attribute('href') 19150 19151 # Discard the start tag: 19152 empty = reader.empty_element() 19153 reader.read() 19154 if empty: 19155 return objs 19156 19157 # Process the inner elements: 19158 while reader.forward(): 19159 objs.append(VnicPassThroughReader.read_one(reader)) 19160 19161 # Discard the end tag: 19162 reader.read() 19163 19164 return objs 19165 19166 19167class VnicProfileReader(Reader): 19168 19169 def __init__(self): 19170 super(VnicProfileReader, self).__init__() 19171 19172 @staticmethod 19173 def read_one(reader): 19174 # Do nothing if there aren't more tags: 19175 if not reader.forward(): 19176 return None 19177 19178 # Create the object: 19179 obj = types.VnicProfile() 19180 19181 # Process the attributes: 19182 obj.href = reader.get_attribute('href') 19183 value = reader.get_attribute('id') 19184 if value is not None: 19185 obj.id = value 19186 19187 # Discard the start tag: 19188 empty = reader.empty_element() 19189 reader.read() 19190 if empty: 19191 return obj 19192 19193 # Process the inner elements: 19194 links = [] 19195 while reader.forward(): 19196 tag = reader.node_name() 19197 if tag == 'comment': 19198 obj.comment = Reader.read_string(reader) 19199 elif tag == 'custom_properties': 19200 obj.custom_properties = CustomPropertyReader.read_many(reader) 19201 elif tag == 'description': 19202 obj.description = Reader.read_string(reader) 19203 elif tag == 'failover': 19204 obj.failover = VnicProfileReader.read_one(reader) 19205 elif tag == 'migratable': 19206 obj.migratable = Reader.read_boolean(reader) 19207 elif tag == 'name': 19208 obj.name = Reader.read_string(reader) 19209 elif tag == 'network': 19210 obj.network = NetworkReader.read_one(reader) 19211 elif tag == 'network_filter': 19212 obj.network_filter = NetworkFilterReader.read_one(reader) 19213 elif tag == 'pass_through': 19214 obj.pass_through = VnicPassThroughReader.read_one(reader) 19215 elif tag == 'permissions': 19216 obj.permissions = PermissionReader.read_many(reader) 19217 elif tag == 'port_mirroring': 19218 obj.port_mirroring = Reader.read_boolean(reader) 19219 elif tag == 'qos': 19220 obj.qos = QosReader.read_one(reader) 19221 elif tag == 'link': 19222 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19223 reader.next_element() 19224 else: 19225 reader.next_element() 19226 for link in links: 19227 VnicProfileReader._process_link(link, obj) 19228 19229 # Discard the end tag: 19230 reader.read() 19231 19232 return obj 19233 19234 @staticmethod 19235 def read_many(reader): 19236 # Do nothing if there aren't more tags: 19237 objs = List() 19238 if not reader.forward(): 19239 return objs 19240 19241 # Process the attributes: 19242 objs.href = reader.get_attribute('href') 19243 19244 # Discard the start tag: 19245 empty = reader.empty_element() 19246 reader.read() 19247 if empty: 19248 return objs 19249 19250 # Process the inner elements: 19251 while reader.forward(): 19252 objs.append(VnicProfileReader.read_one(reader)) 19253 19254 # Discard the end tag: 19255 reader.read() 19256 19257 return objs 19258 19259 @staticmethod 19260 def _process_link(link, obj): 19261 # Process the attributes: 19262 rel = link[0] 19263 href = link[1] 19264 if href and rel: 19265 if rel == "permissions": 19266 if obj.permissions is not None: 19267 obj.permissions.href = href 19268 else: 19269 obj.permissions = List(href) 19270 19271 19272class VnicProfileMappingReader(Reader): 19273 19274 def __init__(self): 19275 super(VnicProfileMappingReader, self).__init__() 19276 19277 @staticmethod 19278 def read_one(reader): 19279 # Do nothing if there aren't more tags: 19280 if not reader.forward(): 19281 return None 19282 19283 # Create the object: 19284 obj = types.VnicProfileMapping() 19285 19286 # Process the attributes: 19287 obj.href = reader.get_attribute('href') 19288 19289 # Discard the start tag: 19290 empty = reader.empty_element() 19291 reader.read() 19292 if empty: 19293 return obj 19294 19295 # Process the inner elements: 19296 links = [] 19297 while reader.forward(): 19298 tag = reader.node_name() 19299 if tag == 'source_network_name': 19300 obj.source_network_name = Reader.read_string(reader) 19301 elif tag == 'source_network_profile_name': 19302 obj.source_network_profile_name = Reader.read_string(reader) 19303 elif tag == 'target_vnic_profile': 19304 obj.target_vnic_profile = VnicProfileReader.read_one(reader) 19305 else: 19306 reader.next_element() 19307 for link in links: 19308 VnicProfileMappingReader._process_link(link, obj) 19309 19310 # Discard the end tag: 19311 reader.read() 19312 19313 return obj 19314 19315 @staticmethod 19316 def read_many(reader): 19317 # Do nothing if there aren't more tags: 19318 objs = List() 19319 if not reader.forward(): 19320 return objs 19321 19322 # Process the attributes: 19323 objs.href = reader.get_attribute('href') 19324 19325 # Discard the start tag: 19326 empty = reader.empty_element() 19327 reader.read() 19328 if empty: 19329 return objs 19330 19331 # Process the inner elements: 19332 while reader.forward(): 19333 objs.append(VnicProfileMappingReader.read_one(reader)) 19334 19335 # Discard the end tag: 19336 reader.read() 19337 19338 return objs 19339 19340 19341class VolumeGroupReader(Reader): 19342 19343 def __init__(self): 19344 super(VolumeGroupReader, self).__init__() 19345 19346 @staticmethod 19347 def read_one(reader): 19348 # Do nothing if there aren't more tags: 19349 if not reader.forward(): 19350 return None 19351 19352 # Create the object: 19353 obj = types.VolumeGroup() 19354 19355 # Process the attributes: 19356 obj.href = reader.get_attribute('href') 19357 value = reader.get_attribute('id') 19358 if value is not None: 19359 obj.id = value 19360 19361 # Discard the start tag: 19362 empty = reader.empty_element() 19363 reader.read() 19364 if empty: 19365 return obj 19366 19367 # Process the inner elements: 19368 links = [] 19369 while reader.forward(): 19370 tag = reader.node_name() 19371 if tag == 'logical_units': 19372 obj.logical_units = LogicalUnitReader.read_many(reader) 19373 elif tag == 'name': 19374 obj.name = Reader.read_string(reader) 19375 else: 19376 reader.next_element() 19377 for link in links: 19378 VolumeGroupReader._process_link(link, obj) 19379 19380 # Discard the end tag: 19381 reader.read() 19382 19383 return obj 19384 19385 @staticmethod 19386 def read_many(reader): 19387 # Do nothing if there aren't more tags: 19388 objs = List() 19389 if not reader.forward(): 19390 return objs 19391 19392 # Process the attributes: 19393 objs.href = reader.get_attribute('href') 19394 19395 # Discard the start tag: 19396 empty = reader.empty_element() 19397 reader.read() 19398 if empty: 19399 return objs 19400 19401 # Process the inner elements: 19402 while reader.forward(): 19403 objs.append(VolumeGroupReader.read_one(reader)) 19404 19405 # Discard the end tag: 19406 reader.read() 19407 19408 return objs 19409 19410 19411class WatchdogReader(Reader): 19412 19413 def __init__(self): 19414 super(WatchdogReader, self).__init__() 19415 19416 @staticmethod 19417 def read_one(reader): 19418 # Do nothing if there aren't more tags: 19419 if not reader.forward(): 19420 return None 19421 19422 # Create the object: 19423 obj = types.Watchdog() 19424 19425 # Process the attributes: 19426 obj.href = reader.get_attribute('href') 19427 value = reader.get_attribute('id') 19428 if value is not None: 19429 obj.id = value 19430 19431 # Discard the start tag: 19432 empty = reader.empty_element() 19433 reader.read() 19434 if empty: 19435 return obj 19436 19437 # Process the inner elements: 19438 links = [] 19439 while reader.forward(): 19440 tag = reader.node_name() 19441 if tag == 'action': 19442 obj.action = Reader.read_enum(types.WatchdogAction, reader) 19443 elif tag == 'comment': 19444 obj.comment = Reader.read_string(reader) 19445 elif tag == 'description': 19446 obj.description = Reader.read_string(reader) 19447 elif tag == 'instance_type': 19448 obj.instance_type = InstanceTypeReader.read_one(reader) 19449 elif tag == 'model': 19450 obj.model = Reader.read_enum(types.WatchdogModel, reader) 19451 elif tag == 'name': 19452 obj.name = Reader.read_string(reader) 19453 elif tag == 'template': 19454 obj.template = TemplateReader.read_one(reader) 19455 elif tag == 'vm': 19456 obj.vm = VmReader.read_one(reader) 19457 elif tag == 'vms': 19458 obj.vms = VmReader.read_many(reader) 19459 elif tag == 'link': 19460 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19461 reader.next_element() 19462 else: 19463 reader.next_element() 19464 for link in links: 19465 WatchdogReader._process_link(link, obj) 19466 19467 # Discard the end tag: 19468 reader.read() 19469 19470 return obj 19471 19472 @staticmethod 19473 def read_many(reader): 19474 # Do nothing if there aren't more tags: 19475 objs = List() 19476 if not reader.forward(): 19477 return objs 19478 19479 # Process the attributes: 19480 objs.href = reader.get_attribute('href') 19481 19482 # Discard the start tag: 19483 empty = reader.empty_element() 19484 reader.read() 19485 if empty: 19486 return objs 19487 19488 # Process the inner elements: 19489 while reader.forward(): 19490 objs.append(WatchdogReader.read_one(reader)) 19491 19492 # Discard the end tag: 19493 reader.read() 19494 19495 return objs 19496 19497 @staticmethod 19498 def _process_link(link, obj): 19499 # Process the attributes: 19500 rel = link[0] 19501 href = link[1] 19502 if href and rel: 19503 if rel == "vms": 19504 if obj.vms is not None: 19505 obj.vms.href = href 19506 else: 19507 obj.vms = List(href) 19508 19509 19510class WeightReader(Reader): 19511 19512 def __init__(self): 19513 super(WeightReader, self).__init__() 19514 19515 @staticmethod 19516 def read_one(reader): 19517 # Do nothing if there aren't more tags: 19518 if not reader.forward(): 19519 return None 19520 19521 # Create the object: 19522 obj = types.Weight() 19523 19524 # Process the attributes: 19525 obj.href = reader.get_attribute('href') 19526 value = reader.get_attribute('id') 19527 if value is not None: 19528 obj.id = value 19529 19530 # Discard the start tag: 19531 empty = reader.empty_element() 19532 reader.read() 19533 if empty: 19534 return obj 19535 19536 # Process the inner elements: 19537 links = [] 19538 while reader.forward(): 19539 tag = reader.node_name() 19540 if tag == 'comment': 19541 obj.comment = Reader.read_string(reader) 19542 elif tag == 'description': 19543 obj.description = Reader.read_string(reader) 19544 elif tag == 'factor': 19545 obj.factor = Reader.read_integer(reader) 19546 elif tag == 'name': 19547 obj.name = Reader.read_string(reader) 19548 elif tag == 'scheduling_policy': 19549 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 19550 elif tag == 'scheduling_policy_unit': 19551 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 19552 else: 19553 reader.next_element() 19554 for link in links: 19555 WeightReader._process_link(link, obj) 19556 19557 # Discard the end tag: 19558 reader.read() 19559 19560 return obj 19561 19562 @staticmethod 19563 def read_many(reader): 19564 # Do nothing if there aren't more tags: 19565 objs = List() 19566 if not reader.forward(): 19567 return objs 19568 19569 # Process the attributes: 19570 objs.href = reader.get_attribute('href') 19571 19572 # Discard the start tag: 19573 empty = reader.empty_element() 19574 reader.read() 19575 if empty: 19576 return objs 19577 19578 # Process the inner elements: 19579 while reader.forward(): 19580 objs.append(WeightReader.read_one(reader)) 19581 19582 # Discard the end tag: 19583 reader.read() 19584 19585 return objs 19586 19587 19588Reader.register('action', ActionReader.read_one) 19589Reader.register('actions', ActionReader.read_many) 19590Reader.register('affinity_group', AffinityGroupReader.read_one) 19591Reader.register('affinity_groups', AffinityGroupReader.read_many) 19592Reader.register('affinity_label', AffinityLabelReader.read_one) 19593Reader.register('affinity_labels', AffinityLabelReader.read_many) 19594Reader.register('affinity_rule', AffinityRuleReader.read_one) 19595Reader.register('affinity_rules', AffinityRuleReader.read_many) 19596Reader.register('agent', AgentReader.read_one) 19597Reader.register('agents', AgentReader.read_many) 19598Reader.register('agent_configuration', AgentConfigurationReader.read_one) 19599Reader.register('agent_configurations', AgentConfigurationReader.read_many) 19600Reader.register('api', ApiReader.read_one) 19601Reader.register('apis', ApiReader.read_many) 19602Reader.register('api_summary', ApiSummaryReader.read_one) 19603Reader.register('api_summaries', ApiSummaryReader.read_many) 19604Reader.register('api_summary_item', ApiSummaryItemReader.read_one) 19605Reader.register('api_summary_items', ApiSummaryItemReader.read_many) 19606Reader.register('application', ApplicationReader.read_one) 19607Reader.register('applications', ApplicationReader.read_many) 19608Reader.register('authorized_key', AuthorizedKeyReader.read_one) 19609Reader.register('authorized_keys', AuthorizedKeyReader.read_many) 19610Reader.register('backup', BackupReader.read_one) 19611Reader.register('backups', BackupReader.read_many) 19612Reader.register('balance', BalanceReader.read_one) 19613Reader.register('balances', BalanceReader.read_many) 19614Reader.register('bios', BiosReader.read_one) 19615Reader.register('bioss', BiosReader.read_many) 19616Reader.register('block_statistic', BlockStatisticReader.read_one) 19617Reader.register('block_statistics', BlockStatisticReader.read_many) 19618Reader.register('bonding', BondingReader.read_one) 19619Reader.register('bondings', BondingReader.read_many) 19620Reader.register('bookmark', BookmarkReader.read_one) 19621Reader.register('bookmarks', BookmarkReader.read_many) 19622Reader.register('boot', BootReader.read_one) 19623Reader.register('boots', BootReader.read_many) 19624Reader.register('boot_menu', BootMenuReader.read_one) 19625Reader.register('boot_menus', BootMenuReader.read_many) 19626Reader.register('brick_profile_detail', BrickProfileDetailReader.read_one) 19627Reader.register('brick_profile_details', BrickProfileDetailReader.read_many) 19628Reader.register('cdrom', CdromReader.read_one) 19629Reader.register('cdroms', CdromReader.read_many) 19630Reader.register('certificate', CertificateReader.read_one) 19631Reader.register('certificates', CertificateReader.read_many) 19632Reader.register('checkpoint', CheckpointReader.read_one) 19633Reader.register('checkpoints', CheckpointReader.read_many) 19634Reader.register('cloud_init', CloudInitReader.read_one) 19635Reader.register('cloud_inits', CloudInitReader.read_many) 19636Reader.register('cluster', ClusterReader.read_one) 19637Reader.register('clusters', ClusterReader.read_many) 19638Reader.register('cluster_feature', ClusterFeatureReader.read_one) 19639Reader.register('cluster_features', ClusterFeatureReader.read_many) 19640Reader.register('cluster_level', ClusterLevelReader.read_one) 19641Reader.register('cluster_levels', ClusterLevelReader.read_many) 19642Reader.register('configuration', ConfigurationReader.read_one) 19643Reader.register('configurations', ConfigurationReader.read_many) 19644Reader.register('console', ConsoleReader.read_one) 19645Reader.register('consoles', ConsoleReader.read_many) 19646Reader.register('core', CoreReader.read_one) 19647Reader.register('cores', CoreReader.read_many) 19648Reader.register('cpu', CpuReader.read_one) 19649Reader.register('cpus', CpuReader.read_many) 19650Reader.register('cpu_profile', CpuProfileReader.read_one) 19651Reader.register('cpu_profiles', CpuProfileReader.read_many) 19652Reader.register('cpu_topology', CpuTopologyReader.read_one) 19653Reader.register('cpu_topologies', CpuTopologyReader.read_many) 19654Reader.register('cpu_tune', CpuTuneReader.read_one) 19655Reader.register('cpu_tunes', CpuTuneReader.read_many) 19656Reader.register('cpu_type', CpuTypeReader.read_one) 19657Reader.register('cpu_types', CpuTypeReader.read_many) 19658Reader.register('custom_property', CustomPropertyReader.read_one) 19659Reader.register('custom_properties', CustomPropertyReader.read_many) 19660Reader.register('data_center', DataCenterReader.read_one) 19661Reader.register('data_centers', DataCenterReader.read_many) 19662Reader.register('device', DeviceReader.read_one) 19663Reader.register('devices', DeviceReader.read_many) 19664Reader.register('disk', DiskReader.read_one) 19665Reader.register('disks', DiskReader.read_many) 19666Reader.register('disk_attachment', DiskAttachmentReader.read_one) 19667Reader.register('disk_attachments', DiskAttachmentReader.read_many) 19668Reader.register('disk_profile', DiskProfileReader.read_one) 19669Reader.register('disk_profiles', DiskProfileReader.read_many) 19670Reader.register('disk_snapshot', DiskSnapshotReader.read_one) 19671Reader.register('disk_snapshots', DiskSnapshotReader.read_many) 19672Reader.register('display', DisplayReader.read_one) 19673Reader.register('displays', DisplayReader.read_many) 19674Reader.register('dns', DnsReader.read_one) 19675Reader.register('dnss', DnsReader.read_many) 19676Reader.register('dns_resolver_configuration', DnsResolverConfigurationReader.read_one) 19677Reader.register('dns_resolver_configurations', DnsResolverConfigurationReader.read_many) 19678Reader.register('domain', DomainReader.read_one) 19679Reader.register('domains', DomainReader.read_many) 19680Reader.register('dynamic_cpu', DynamicCpuReader.read_one) 19681Reader.register('dynamic_cpus', DynamicCpuReader.read_many) 19682Reader.register('entity_profile_detail', EntityProfileDetailReader.read_one) 19683Reader.register('entity_profile_details', EntityProfileDetailReader.read_many) 19684Reader.register('error_handling', ErrorHandlingReader.read_one) 19685Reader.register('error_handlings', ErrorHandlingReader.read_many) 19686Reader.register('event', EventReader.read_one) 19687Reader.register('events', EventReader.read_many) 19688Reader.register('event_subscription', EventSubscriptionReader.read_one) 19689Reader.register('event_subscriptions', EventSubscriptionReader.read_many) 19690Reader.register('external_compute_resource', ExternalComputeResourceReader.read_one) 19691Reader.register('external_compute_resources', ExternalComputeResourceReader.read_many) 19692Reader.register('external_discovered_host', ExternalDiscoveredHostReader.read_one) 19693Reader.register('external_discovered_hosts', ExternalDiscoveredHostReader.read_many) 19694Reader.register('external_host', ExternalHostReader.read_one) 19695Reader.register('external_hosts', ExternalHostReader.read_many) 19696Reader.register('external_host_group', ExternalHostGroupReader.read_one) 19697Reader.register('external_host_groups', ExternalHostGroupReader.read_many) 19698Reader.register('external_host_provider', ExternalHostProviderReader.read_one) 19699Reader.register('external_host_providers', ExternalHostProviderReader.read_many) 19700Reader.register('external_network_provider_configuration', ExternalNetworkProviderConfigurationReader.read_one) 19701Reader.register('external_network_provider_configurations', ExternalNetworkProviderConfigurationReader.read_many) 19702Reader.register('external_provider', ExternalProviderReader.read_one) 19703Reader.register('external_providers', ExternalProviderReader.read_many) 19704Reader.register('external_template_import', ExternalTemplateImportReader.read_one) 19705Reader.register('external_template_imports', ExternalTemplateImportReader.read_many) 19706Reader.register('external_vm_import', ExternalVmImportReader.read_one) 19707Reader.register('external_vm_imports', ExternalVmImportReader.read_many) 19708Reader.register('fault', FaultReader.read_one) 19709Reader.register('faults', FaultReader.read_many) 19710Reader.register('fencing_policy', FencingPolicyReader.read_one) 19711Reader.register('fencing_policies', FencingPolicyReader.read_many) 19712Reader.register('file', FileReader.read_one) 19713Reader.register('files', FileReader.read_many) 19714Reader.register('filter', FilterReader.read_one) 19715Reader.register('filters', FilterReader.read_many) 19716Reader.register('floppy', FloppyReader.read_one) 19717Reader.register('floppies', FloppyReader.read_many) 19718Reader.register('fop_statistic', FopStatisticReader.read_one) 19719Reader.register('fop_statistics', FopStatisticReader.read_many) 19720Reader.register('brick', GlusterBrickReader.read_one) 19721Reader.register('bricks', GlusterBrickReader.read_many) 19722Reader.register('gluster_brick_advanced_details', GlusterBrickAdvancedDetailsReader.read_one) 19723Reader.register('gluster_brick_advanced_detailss', GlusterBrickAdvancedDetailsReader.read_many) 19724Reader.register('brick_memoryinfo', GlusterBrickMemoryInfoReader.read_one) 19725Reader.register('gluster_brick_memory_infos', GlusterBrickMemoryInfoReader.read_many) 19726Reader.register('gluster_client', GlusterClientReader.read_one) 19727Reader.register('gluster_clients', GlusterClientReader.read_many) 19728Reader.register('gluster_hook', GlusterHookReader.read_one) 19729Reader.register('gluster_hooks', GlusterHookReader.read_many) 19730Reader.register('memory_pool', GlusterMemoryPoolReader.read_one) 19731Reader.register('memory_pools', GlusterMemoryPoolReader.read_many) 19732Reader.register('server_hook', GlusterServerHookReader.read_one) 19733Reader.register('server_hooks', GlusterServerHookReader.read_many) 19734Reader.register('gluster_volume', GlusterVolumeReader.read_one) 19735Reader.register('gluster_volumes', GlusterVolumeReader.read_many) 19736Reader.register('gluster_volume_profile_details', GlusterVolumeProfileDetailsReader.read_one) 19737Reader.register('gluster_volume_profile_detailss', GlusterVolumeProfileDetailsReader.read_many) 19738Reader.register('grace_period', GracePeriodReader.read_one) 19739Reader.register('grace_periods', GracePeriodReader.read_many) 19740Reader.register('graphics_console', GraphicsConsoleReader.read_one) 19741Reader.register('graphics_consoles', GraphicsConsoleReader.read_many) 19742Reader.register('group', GroupReader.read_one) 19743Reader.register('groups', GroupReader.read_many) 19744Reader.register('guest_operating_system', GuestOperatingSystemReader.read_one) 19745Reader.register('guest_operating_systems', GuestOperatingSystemReader.read_many) 19746Reader.register('hardware_information', HardwareInformationReader.read_one) 19747Reader.register('hardware_informations', HardwareInformationReader.read_many) 19748Reader.register('high_availability', HighAvailabilityReader.read_one) 19749Reader.register('high_availabilities', HighAvailabilityReader.read_many) 19750Reader.register('hook', HookReader.read_one) 19751Reader.register('hooks', HookReader.read_many) 19752Reader.register('host', HostReader.read_one) 19753Reader.register('hosts', HostReader.read_many) 19754Reader.register('host_cpu_unit', HostCpuUnitReader.read_one) 19755Reader.register('host_cpu_units', HostCpuUnitReader.read_many) 19756Reader.register('host_device', HostDeviceReader.read_one) 19757Reader.register('host_devices', HostDeviceReader.read_many) 19758Reader.register('host_device_passthrough', HostDevicePassthroughReader.read_one) 19759Reader.register('host_device_passthroughs', HostDevicePassthroughReader.read_many) 19760Reader.register('host_nic', HostNicReader.read_one) 19761Reader.register('host_nics', HostNicReader.read_many) 19762Reader.register('host_nic_virtual_functions_configuration', HostNicVirtualFunctionsConfigurationReader.read_one) 19763Reader.register('host_nic_virtual_functions_configurations', HostNicVirtualFunctionsConfigurationReader.read_many) 19764Reader.register('host_storage', HostStorageReader.read_one) 19765Reader.register('host_storages', HostStorageReader.read_many) 19766Reader.register('hosted_engine', HostedEngineReader.read_one) 19767Reader.register('hosted_engines', HostedEngineReader.read_many) 19768Reader.register('icon', IconReader.read_one) 19769Reader.register('icons', IconReader.read_many) 19770Reader.register('identified', IdentifiedReader.read_one) 19771Reader.register('identifieds', IdentifiedReader.read_many) 19772Reader.register('image', ImageReader.read_one) 19773Reader.register('images', ImageReader.read_many) 19774Reader.register('image_transfer', ImageTransferReader.read_one) 19775Reader.register('image_transfers', ImageTransferReader.read_many) 19776Reader.register('initialization', InitializationReader.read_one) 19777Reader.register('initializations', InitializationReader.read_many) 19778Reader.register('instance_type', InstanceTypeReader.read_one) 19779Reader.register('instance_types', InstanceTypeReader.read_many) 19780Reader.register('io', IoReader.read_one) 19781Reader.register('ios', IoReader.read_many) 19782Reader.register('ip', IpReader.read_one) 19783Reader.register('ips', IpReader.read_many) 19784Reader.register('ip_address_assignment', IpAddressAssignmentReader.read_one) 19785Reader.register('ip_address_assignments', IpAddressAssignmentReader.read_many) 19786Reader.register('iscsi_bond', IscsiBondReader.read_one) 19787Reader.register('iscsi_bonds', IscsiBondReader.read_many) 19788Reader.register('iscsi_details', IscsiDetailsReader.read_one) 19789Reader.register('iscsi_detailss', IscsiDetailsReader.read_many) 19790Reader.register('job', JobReader.read_one) 19791Reader.register('jobs', JobReader.read_many) 19792Reader.register('katello_erratum', KatelloErratumReader.read_one) 19793Reader.register('katello_errata', KatelloErratumReader.read_many) 19794Reader.register('kernel', KernelReader.read_one) 19795Reader.register('kernels', KernelReader.read_many) 19796Reader.register('ksm', KsmReader.read_one) 19797Reader.register('ksms', KsmReader.read_many) 19798Reader.register('link_layer_discovery_protocol_element', LinkLayerDiscoveryProtocolElementReader.read_one) 19799Reader.register('link_layer_discovery_protocol_elements', LinkLayerDiscoveryProtocolElementReader.read_many) 19800Reader.register('logical_unit', LogicalUnitReader.read_one) 19801Reader.register('logical_units', LogicalUnitReader.read_many) 19802Reader.register('m_dev_type', MDevTypeReader.read_one) 19803Reader.register('m_dev_types', MDevTypeReader.read_many) 19804Reader.register('mac', MacReader.read_one) 19805Reader.register('macs', MacReader.read_many) 19806Reader.register('mac_pool', MacPoolReader.read_one) 19807Reader.register('mac_pools', MacPoolReader.read_many) 19808Reader.register('memory_over_commit', MemoryOverCommitReader.read_one) 19809Reader.register('memory_over_commits', MemoryOverCommitReader.read_many) 19810Reader.register('memory_policy', MemoryPolicyReader.read_one) 19811Reader.register('memory_policies', MemoryPolicyReader.read_many) 19812Reader.register('method', MethodReader.read_one) 19813Reader.register('methods', MethodReader.read_many) 19814Reader.register('migration_bandwidth', MigrationBandwidthReader.read_one) 19815Reader.register('migration_bandwidths', MigrationBandwidthReader.read_many) 19816Reader.register('migration', MigrationOptionsReader.read_one) 19817Reader.register('migration_optionss', MigrationOptionsReader.read_many) 19818Reader.register('migration_policy', MigrationPolicyReader.read_one) 19819Reader.register('migration_policies', MigrationPolicyReader.read_many) 19820Reader.register('network', NetworkReader.read_one) 19821Reader.register('networks', NetworkReader.read_many) 19822Reader.register('network_attachment', NetworkAttachmentReader.read_one) 19823Reader.register('network_attachments', NetworkAttachmentReader.read_many) 19824Reader.register('network_configuration', NetworkConfigurationReader.read_one) 19825Reader.register('network_configurations', NetworkConfigurationReader.read_many) 19826Reader.register('network_filter', NetworkFilterReader.read_one) 19827Reader.register('network_filters', NetworkFilterReader.read_many) 19828Reader.register('network_filter_parameter', NetworkFilterParameterReader.read_one) 19829Reader.register('network_filter_parameters', NetworkFilterParameterReader.read_many) 19830Reader.register('network_label', NetworkLabelReader.read_one) 19831Reader.register('network_labels', NetworkLabelReader.read_many) 19832Reader.register('nfs_profile_detail', NfsProfileDetailReader.read_one) 19833Reader.register('nfs_profile_details', NfsProfileDetailReader.read_many) 19834Reader.register('nic', NicReader.read_one) 19835Reader.register('nics', NicReader.read_many) 19836Reader.register('nic_configuration', NicConfigurationReader.read_one) 19837Reader.register('nic_configurations', NicConfigurationReader.read_many) 19838Reader.register('host_numa_node', NumaNodeReader.read_one) 19839Reader.register('host_numa_nodes', NumaNodeReader.read_many) 19840Reader.register('numa_node_pin', NumaNodePinReader.read_one) 19841Reader.register('numa_node_pins', NumaNodePinReader.read_many) 19842Reader.register('openstack_image', OpenStackImageReader.read_one) 19843Reader.register('openstack_images', OpenStackImageReader.read_many) 19844Reader.register('openstack_image_provider', OpenStackImageProviderReader.read_one) 19845Reader.register('openstack_image_providers', OpenStackImageProviderReader.read_many) 19846Reader.register('openstack_network', OpenStackNetworkReader.read_one) 19847Reader.register('openstack_networks', OpenStackNetworkReader.read_many) 19848Reader.register('openstack_network_provider', OpenStackNetworkProviderReader.read_one) 19849Reader.register('openstack_network_providers', OpenStackNetworkProviderReader.read_many) 19850Reader.register('open_stack_provider', OpenStackProviderReader.read_one) 19851Reader.register('open_stack_providers', OpenStackProviderReader.read_many) 19852Reader.register('openstack_subnet', OpenStackSubnetReader.read_one) 19853Reader.register('openstack_subnets', OpenStackSubnetReader.read_many) 19854Reader.register('openstack_volume_provider', OpenStackVolumeProviderReader.read_one) 19855Reader.register('openstack_volume_providers', OpenStackVolumeProviderReader.read_many) 19856Reader.register('open_stack_volume_type', OpenStackVolumeTypeReader.read_one) 19857Reader.register('open_stack_volume_types', OpenStackVolumeTypeReader.read_many) 19858Reader.register('openstack_volume_authentication_key', OpenstackVolumeAuthenticationKeyReader.read_one) 19859Reader.register('openstack_volume_authentication_keys', OpenstackVolumeAuthenticationKeyReader.read_many) 19860Reader.register('os', OperatingSystemReader.read_one) 19861Reader.register('oss', OperatingSystemReader.read_many) 19862Reader.register('operating_system', OperatingSystemInfoReader.read_one) 19863Reader.register('operation_systems', OperatingSystemInfoReader.read_many) 19864Reader.register('option', OptionReader.read_one) 19865Reader.register('options', OptionReader.read_many) 19866Reader.register('package', PackageReader.read_one) 19867Reader.register('packages', PackageReader.read_many) 19868Reader.register('payload', PayloadReader.read_one) 19869Reader.register('payloads', PayloadReader.read_many) 19870Reader.register('permission', PermissionReader.read_one) 19871Reader.register('permissions', PermissionReader.read_many) 19872Reader.register('permit', PermitReader.read_one) 19873Reader.register('permits', PermitReader.read_many) 19874Reader.register('pm_proxy', PmProxyReader.read_one) 19875Reader.register('pm_proxies', PmProxyReader.read_many) 19876Reader.register('port_mirroring', PortMirroringReader.read_one) 19877Reader.register('port_mirrorings', PortMirroringReader.read_many) 19878Reader.register('power_management', PowerManagementReader.read_one) 19879Reader.register('power_managements', PowerManagementReader.read_many) 19880Reader.register('product', ProductReader.read_one) 19881Reader.register('products', ProductReader.read_many) 19882Reader.register('product_info', ProductInfoReader.read_one) 19883Reader.register('product_infos', ProductInfoReader.read_many) 19884Reader.register('profile_detail', ProfileDetailReader.read_one) 19885Reader.register('profile_details', ProfileDetailReader.read_many) 19886Reader.register('property', PropertyReader.read_one) 19887Reader.register('properties', PropertyReader.read_many) 19888Reader.register('proxy_ticket', ProxyTicketReader.read_one) 19889Reader.register('proxy_tickets', ProxyTicketReader.read_many) 19890Reader.register('qos', QosReader.read_one) 19891Reader.register('qoss', QosReader.read_many) 19892Reader.register('quota', QuotaReader.read_one) 19893Reader.register('quotas', QuotaReader.read_many) 19894Reader.register('quota_cluster_limit', QuotaClusterLimitReader.read_one) 19895Reader.register('quota_cluster_limits', QuotaClusterLimitReader.read_many) 19896Reader.register('quota_storage_limit', QuotaStorageLimitReader.read_one) 19897Reader.register('quota_storage_limits', QuotaStorageLimitReader.read_many) 19898Reader.register('range', RangeReader.read_one) 19899Reader.register('ranges', RangeReader.read_many) 19900Reader.register('rate', RateReader.read_one) 19901Reader.register('rates', RateReader.read_many) 19902Reader.register('registration_affinity_group_mapping', RegistrationAffinityGroupMappingReader.read_one) 19903Reader.register('registration_affinity_group_mappings', RegistrationAffinityGroupMappingReader.read_many) 19904Reader.register('registration_affinity_label_mapping', RegistrationAffinityLabelMappingReader.read_one) 19905Reader.register('registration_affinity_label_mappings', RegistrationAffinityLabelMappingReader.read_many) 19906Reader.register('registration_cluster_mapping', RegistrationClusterMappingReader.read_one) 19907Reader.register('registration_cluster_mappings', RegistrationClusterMappingReader.read_many) 19908Reader.register('registration_configuration', RegistrationConfigurationReader.read_one) 19909Reader.register('registration_configurations', RegistrationConfigurationReader.read_many) 19910Reader.register('registration_domain_mapping', RegistrationDomainMappingReader.read_one) 19911Reader.register('registration_domain_mappings', RegistrationDomainMappingReader.read_many) 19912Reader.register('registration_lun_mapping', RegistrationLunMappingReader.read_one) 19913Reader.register('registration_lun_mappings', RegistrationLunMappingReader.read_many) 19914Reader.register('registration_role_mapping', RegistrationRoleMappingReader.read_one) 19915Reader.register('registration_role_mappings', RegistrationRoleMappingReader.read_many) 19916Reader.register('registration_vnic_profile_mapping', RegistrationVnicProfileMappingReader.read_one) 19917Reader.register('registration_vnic_profile_mappings', RegistrationVnicProfileMappingReader.read_many) 19918Reader.register('reported_configuration', ReportedConfigurationReader.read_one) 19919Reader.register('reported_configurations', ReportedConfigurationReader.read_many) 19920Reader.register('reported_device', ReportedDeviceReader.read_one) 19921Reader.register('reported_devices', ReportedDeviceReader.read_many) 19922Reader.register('rng_device', RngDeviceReader.read_one) 19923Reader.register('rng_devices', RngDeviceReader.read_many) 19924Reader.register('role', RoleReader.read_one) 19925Reader.register('roles', RoleReader.read_many) 19926Reader.register('scheduling_policy', SchedulingPolicyReader.read_one) 19927Reader.register('scheduling_policies', SchedulingPolicyReader.read_many) 19928Reader.register('scheduling_policy_unit', SchedulingPolicyUnitReader.read_one) 19929Reader.register('scheduling_policy_units', SchedulingPolicyUnitReader.read_many) 19930Reader.register('se_linux', SeLinuxReader.read_one) 19931Reader.register('se_linuxs', SeLinuxReader.read_many) 19932Reader.register('serial_number', SerialNumberReader.read_one) 19933Reader.register('serial_numbers', SerialNumberReader.read_many) 19934Reader.register('session', SessionReader.read_one) 19935Reader.register('sessions', SessionReader.read_many) 19936Reader.register('skip_if_connectivity_broken', SkipIfConnectivityBrokenReader.read_one) 19937Reader.register('skip_if_connectivity_brokens', SkipIfConnectivityBrokenReader.read_many) 19938Reader.register('skip_if_sd_active', SkipIfSdActiveReader.read_one) 19939Reader.register('skip_if_sd_actives', SkipIfSdActiveReader.read_many) 19940Reader.register('snapshot', SnapshotReader.read_one) 19941Reader.register('snapshots', SnapshotReader.read_many) 19942Reader.register('special_objects', SpecialObjectsReader.read_one) 19943Reader.register('special_objectss', SpecialObjectsReader.read_many) 19944Reader.register('spm', SpmReader.read_one) 19945Reader.register('spms', SpmReader.read_many) 19946Reader.register('ssh', SshReader.read_one) 19947Reader.register('sshs', SshReader.read_many) 19948Reader.register('ssh_public_key', SshPublicKeyReader.read_one) 19949Reader.register('ssh_public_keys', SshPublicKeyReader.read_many) 19950Reader.register('sso', SsoReader.read_one) 19951Reader.register('ssos', SsoReader.read_many) 19952Reader.register('statistic', StatisticReader.read_one) 19953Reader.register('statistics', StatisticReader.read_many) 19954Reader.register('step', StepReader.read_one) 19955Reader.register('steps', StepReader.read_many) 19956Reader.register('storage_connection', StorageConnectionReader.read_one) 19957Reader.register('storage_connections', StorageConnectionReader.read_many) 19958Reader.register('storage_connection_extension', StorageConnectionExtensionReader.read_one) 19959Reader.register('storage_connection_extensions', StorageConnectionExtensionReader.read_many) 19960Reader.register('storage_domain', StorageDomainReader.read_one) 19961Reader.register('storage_domains', StorageDomainReader.read_many) 19962Reader.register('storage_domain_lease', StorageDomainLeaseReader.read_one) 19963Reader.register('storage_domain_leases', StorageDomainLeaseReader.read_many) 19964Reader.register('system_option', SystemOptionReader.read_one) 19965Reader.register('system_options', SystemOptionReader.read_many) 19966Reader.register('system_option_value', SystemOptionValueReader.read_one) 19967Reader.register('system_option_values', SystemOptionValueReader.read_many) 19968Reader.register('tag', TagReader.read_one) 19969Reader.register('tags', TagReader.read_many) 19970Reader.register('template', TemplateReader.read_one) 19971Reader.register('templates', TemplateReader.read_many) 19972Reader.register('template_version', TemplateVersionReader.read_one) 19973Reader.register('template_versions', TemplateVersionReader.read_many) 19974Reader.register('ticket', TicketReader.read_one) 19975Reader.register('tickets', TicketReader.read_many) 19976Reader.register('time_zone', TimeZoneReader.read_one) 19977Reader.register('time_zones', TimeZoneReader.read_many) 19978Reader.register('transparent_hugepages', TransparentHugePagesReader.read_one) 19979Reader.register('transparent_huge_pagess', TransparentHugePagesReader.read_many) 19980Reader.register('unmanaged_network', UnmanagedNetworkReader.read_one) 19981Reader.register('unmanaged_networks', UnmanagedNetworkReader.read_many) 19982Reader.register('usb', UsbReader.read_one) 19983Reader.register('usbs', UsbReader.read_many) 19984Reader.register('user', UserReader.read_one) 19985Reader.register('users', UserReader.read_many) 19986Reader.register('user_option', UserOptionReader.read_one) 19987Reader.register('user_options', UserOptionReader.read_many) 19988Reader.register('value', ValueReader.read_one) 19989Reader.register('values', ValueReader.read_many) 19990Reader.register('vcpu_pin', VcpuPinReader.read_one) 19991Reader.register('vcpu_pins', VcpuPinReader.read_many) 19992Reader.register('vendor', VendorReader.read_one) 19993Reader.register('vendors', VendorReader.read_many) 19994Reader.register('version', VersionReader.read_one) 19995Reader.register('versions', VersionReader.read_many) 19996Reader.register('virtio_scsi', VirtioScsiReader.read_one) 19997Reader.register('virtio_scsis', VirtioScsiReader.read_many) 19998Reader.register('vm_numa_node', VirtualNumaNodeReader.read_one) 19999Reader.register('vm_numa_nodes', VirtualNumaNodeReader.read_many) 20000Reader.register('vlan', VlanReader.read_one) 20001Reader.register('vlans', VlanReader.read_many) 20002Reader.register('vm', VmReader.read_one) 20003Reader.register('vms', VmReader.read_many) 20004Reader.register('vm_base', VmBaseReader.read_one) 20005Reader.register('vm_bases', VmBaseReader.read_many) 20006Reader.register('vm_mediated_device', VmMediatedDeviceReader.read_one) 20007Reader.register('vm_mediated_devices', VmMediatedDeviceReader.read_many) 20008Reader.register('vm_placement_policy', VmPlacementPolicyReader.read_one) 20009Reader.register('vm_placement_policies', VmPlacementPolicyReader.read_many) 20010Reader.register('vm_pool', VmPoolReader.read_one) 20011Reader.register('vm_pools', VmPoolReader.read_many) 20012Reader.register('vm_summary', VmSummaryReader.read_one) 20013Reader.register('vm_summaries', VmSummaryReader.read_many) 20014Reader.register('vnic_pass_through', VnicPassThroughReader.read_one) 20015Reader.register('vnic_pass_throughs', VnicPassThroughReader.read_many) 20016Reader.register('vnic_profile', VnicProfileReader.read_one) 20017Reader.register('vnic_profiles', VnicProfileReader.read_many) 20018Reader.register('vnic_profile_mapping', VnicProfileMappingReader.read_one) 20019Reader.register('vnic_profile_mappings', VnicProfileMappingReader.read_many) 20020Reader.register('volume_group', VolumeGroupReader.read_one) 20021Reader.register('volume_groups', VolumeGroupReader.read_many) 20022Reader.register('watchdog', WatchdogReader.read_one) 20023Reader.register('watchdogs', WatchdogReader.read_many) 20024Reader.register('weight', WeightReader.read_one) 20025Reader.register('weights', WeightReader.read_many)
26class ActionReader(Reader): 27 28 def __init__(self): 29 super(ActionReader, self).__init__() 30 31 @staticmethod 32 def read_one(reader): 33 # Do nothing if there aren't more tags: 34 if not reader.forward(): 35 return None 36 37 # Create the object: 38 obj = types.Action() 39 40 # Process the attributes: 41 obj.href = reader.get_attribute('href') 42 value = reader.get_attribute('id') 43 if value is not None: 44 obj.id = value 45 46 # Discard the start tag: 47 empty = reader.empty_element() 48 reader.read() 49 if empty: 50 return obj 51 52 # Process the inner elements: 53 links = [] 54 while reader.forward(): 55 tag = reader.node_name() 56 if tag == 'activate': 57 obj.activate = Reader.read_boolean(reader) 58 elif tag == 'allow_partial_import': 59 obj.allow_partial_import = Reader.read_boolean(reader) 60 elif tag == 'async': 61 obj.async_ = Reader.read_boolean(reader) 62 elif tag == 'attachment': 63 obj.attachment = DiskAttachmentReader.read_one(reader) 64 elif tag == 'authorized_key': 65 obj.authorized_key = AuthorizedKeyReader.read_one(reader) 66 elif tag == 'auto_pinning_policy': 67 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 68 elif tag == 'bricks': 69 obj.bricks = GlusterBrickReader.read_many(reader) 70 elif tag == 'certificates': 71 obj.certificates = CertificateReader.read_many(reader) 72 elif tag == 'check_connectivity': 73 obj.check_connectivity = Reader.read_boolean(reader) 74 elif tag == 'clone': 75 obj.clone = Reader.read_boolean(reader) 76 elif tag == 'clone_permissions': 77 obj.clone_permissions = Reader.read_boolean(reader) 78 elif tag == 'cluster': 79 obj.cluster = ClusterReader.read_one(reader) 80 elif tag == 'collapse_snapshots': 81 obj.collapse_snapshots = Reader.read_boolean(reader) 82 elif tag == 'comment': 83 obj.comment = Reader.read_string(reader) 84 elif tag == 'commit_on_success': 85 obj.commit_on_success = Reader.read_boolean(reader) 86 elif tag == 'connection': 87 obj.connection = StorageConnectionReader.read_one(reader) 88 elif tag == 'connectivity_timeout': 89 obj.connectivity_timeout = Reader.read_integer(reader) 90 elif tag == 'correlation_id': 91 obj.correlation_id = Reader.read_string(reader) 92 elif tag == 'data_center': 93 obj.data_center = DataCenterReader.read_one(reader) 94 elif tag == 'deploy_hosted_engine': 95 obj.deploy_hosted_engine = Reader.read_boolean(reader) 96 elif tag == 'description': 97 obj.description = Reader.read_string(reader) 98 elif tag == 'details': 99 obj.details = GlusterVolumeProfileDetailsReader.read_one(reader) 100 elif tag == 'directory': 101 obj.directory = Reader.read_string(reader) 102 elif tag == 'discard_snapshots': 103 obj.discard_snapshots = Reader.read_boolean(reader) 104 elif tag == 'discovered_targets': 105 obj.discovered_targets = IscsiDetailsReader.read_many(reader) 106 elif tag == 'disk': 107 obj.disk = DiskReader.read_one(reader) 108 elif tag == 'disk_profile': 109 obj.disk_profile = DiskProfileReader.read_one(reader) 110 elif tag == 'disks': 111 obj.disks = DiskReader.read_many(reader) 112 elif tag == 'exclusive': 113 obj.exclusive = Reader.read_boolean(reader) 114 elif tag == 'fault': 115 obj.fault = FaultReader.read_one(reader) 116 elif tag == 'fence_type': 117 obj.fence_type = Reader.read_string(reader) 118 elif tag == 'filename': 119 obj.filename = Reader.read_string(reader) 120 elif tag == 'filter': 121 obj.filter = Reader.read_boolean(reader) 122 elif tag == 'fix_layout': 123 obj.fix_layout = Reader.read_boolean(reader) 124 elif tag == 'follow': 125 obj.follow = Reader.read_string(reader) 126 elif tag == 'force': 127 obj.force = Reader.read_boolean(reader) 128 elif tag == 'grace_period': 129 obj.grace_period = GracePeriodReader.read_one(reader) 130 elif tag == 'host': 131 obj.host = HostReader.read_one(reader) 132 elif tag == 'image': 133 obj.image = Reader.read_string(reader) 134 elif tag == 'image_transfer': 135 obj.image_transfer = ImageTransferReader.read_one(reader) 136 elif tag == 'import_as_template': 137 obj.import_as_template = Reader.read_boolean(reader) 138 elif tag == 'is_attached': 139 obj.is_attached = Reader.read_boolean(reader) 140 elif tag == 'iscsi': 141 obj.iscsi = IscsiDetailsReader.read_one(reader) 142 elif tag == 'iscsi_targets': 143 obj.iscsi_targets = Reader.read_strings(reader) 144 elif tag == 'job': 145 obj.job = JobReader.read_one(reader) 146 elif tag == 'lease': 147 obj.lease = StorageDomainLeaseReader.read_one(reader) 148 elif tag == 'logical_units': 149 obj.logical_units = LogicalUnitReader.read_many(reader) 150 elif tag == 'maintenance_after_restart': 151 obj.maintenance_after_restart = Reader.read_boolean(reader) 152 elif tag == 'maintenance_enabled': 153 obj.maintenance_enabled = Reader.read_boolean(reader) 154 elif tag == 'migrate_vms_in_affinity_closure': 155 obj.migrate_vms_in_affinity_closure = Reader.read_boolean(reader) 156 elif tag == 'modified_bonds': 157 obj.modified_bonds = HostNicReader.read_many(reader) 158 elif tag == 'modified_labels': 159 obj.modified_labels = NetworkLabelReader.read_many(reader) 160 elif tag == 'modified_network_attachments': 161 obj.modified_network_attachments = NetworkAttachmentReader.read_many(reader) 162 elif tag == 'name': 163 obj.name = Reader.read_string(reader) 164 elif tag == 'optimize_cpu_settings': 165 obj.optimize_cpu_settings = Reader.read_boolean(reader) 166 elif tag == 'option': 167 obj.option = OptionReader.read_one(reader) 168 elif tag == 'pause': 169 obj.pause = Reader.read_boolean(reader) 170 elif tag == 'permission': 171 obj.permission = PermissionReader.read_one(reader) 172 elif tag == 'power_management': 173 obj.power_management = PowerManagementReader.read_one(reader) 174 elif tag == 'proxy_ticket': 175 obj.proxy_ticket = ProxyTicketReader.read_one(reader) 176 elif tag == 'quota': 177 obj.quota = QuotaReader.read_one(reader) 178 elif tag == 'reason': 179 obj.reason = Reader.read_string(reader) 180 elif tag == 'reassign_bad_macs': 181 obj.reassign_bad_macs = Reader.read_boolean(reader) 182 elif tag == 'reboot': 183 obj.reboot = Reader.read_boolean(reader) 184 elif tag == 'registration_configuration': 185 obj.registration_configuration = RegistrationConfigurationReader.read_one(reader) 186 elif tag == 'remote_viewer_connection_file': 187 obj.remote_viewer_connection_file = Reader.read_string(reader) 188 elif tag == 'removed_bonds': 189 obj.removed_bonds = HostNicReader.read_many(reader) 190 elif tag == 'removed_labels': 191 obj.removed_labels = NetworkLabelReader.read_many(reader) 192 elif tag == 'removed_network_attachments': 193 obj.removed_network_attachments = NetworkAttachmentReader.read_many(reader) 194 elif tag == 'resolution_type': 195 obj.resolution_type = Reader.read_string(reader) 196 elif tag == 'restore_memory': 197 obj.restore_memory = Reader.read_boolean(reader) 198 elif tag == 'root_password': 199 obj.root_password = Reader.read_string(reader) 200 elif tag == 'seal': 201 obj.seal = Reader.read_boolean(reader) 202 elif tag == 'snapshot': 203 obj.snapshot = SnapshotReader.read_one(reader) 204 elif tag == 'source_host': 205 obj.source_host = HostReader.read_one(reader) 206 elif tag == 'ssh': 207 obj.ssh = SshReader.read_one(reader) 208 elif tag == 'status': 209 obj.status = Reader.read_string(reader) 210 elif tag == 'stop_gluster_service': 211 obj.stop_gluster_service = Reader.read_boolean(reader) 212 elif tag == 'storage_domain': 213 obj.storage_domain = StorageDomainReader.read_one(reader) 214 elif tag == 'storage_domains': 215 obj.storage_domains = StorageDomainReader.read_many(reader) 216 elif tag == 'succeeded': 217 obj.succeeded = Reader.read_boolean(reader) 218 elif tag == 'synchronized_network_attachments': 219 obj.synchronized_network_attachments = NetworkAttachmentReader.read_many(reader) 220 elif tag == 'template': 221 obj.template = TemplateReader.read_one(reader) 222 elif tag == 'ticket': 223 obj.ticket = TicketReader.read_one(reader) 224 elif tag == 'timeout': 225 obj.timeout = Reader.read_integer(reader) 226 elif tag == 'undeploy_hosted_engine': 227 obj.undeploy_hosted_engine = Reader.read_boolean(reader) 228 elif tag == 'upgrade_action': 229 obj.upgrade_action = Reader.read_enum(types.ClusterUpgradeAction, reader) 230 elif tag == 'upgrade_percent_complete': 231 obj.upgrade_percent_complete = Reader.read_integer(reader) 232 elif tag == 'use_cloud_init': 233 obj.use_cloud_init = Reader.read_boolean(reader) 234 elif tag == 'use_ignition': 235 obj.use_ignition = Reader.read_boolean(reader) 236 elif tag == 'use_initialization': 237 obj.use_initialization = Reader.read_boolean(reader) 238 elif tag == 'use_sysprep': 239 obj.use_sysprep = Reader.read_boolean(reader) 240 elif tag == 'virtual_functions_configuration': 241 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 242 elif tag == 'vm': 243 obj.vm = VmReader.read_one(reader) 244 elif tag == 'vnic_profile_mappings': 245 obj.vnic_profile_mappings = VnicProfileMappingReader.read_many(reader) 246 elif tag == 'volatile': 247 obj.volatile = Reader.read_boolean(reader) 248 else: 249 reader.next_element() 250 for link in links: 251 ActionReader._process_link(link, obj) 252 253 # Discard the end tag: 254 reader.read() 255 256 return obj 257 258 @staticmethod 259 def read_many(reader): 260 # Do nothing if there aren't more tags: 261 objs = List() 262 if not reader.forward(): 263 return objs 264 265 # Process the attributes: 266 objs.href = reader.get_attribute('href') 267 268 # Discard the start tag: 269 empty = reader.empty_element() 270 reader.read() 271 if empty: 272 return objs 273 274 # Process the inner elements: 275 while reader.forward(): 276 objs.append(ActionReader.read_one(reader)) 277 278 # Discard the end tag: 279 reader.read() 280 281 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
31 @staticmethod 32 def read_one(reader): 33 # Do nothing if there aren't more tags: 34 if not reader.forward(): 35 return None 36 37 # Create the object: 38 obj = types.Action() 39 40 # Process the attributes: 41 obj.href = reader.get_attribute('href') 42 value = reader.get_attribute('id') 43 if value is not None: 44 obj.id = value 45 46 # Discard the start tag: 47 empty = reader.empty_element() 48 reader.read() 49 if empty: 50 return obj 51 52 # Process the inner elements: 53 links = [] 54 while reader.forward(): 55 tag = reader.node_name() 56 if tag == 'activate': 57 obj.activate = Reader.read_boolean(reader) 58 elif tag == 'allow_partial_import': 59 obj.allow_partial_import = Reader.read_boolean(reader) 60 elif tag == 'async': 61 obj.async_ = Reader.read_boolean(reader) 62 elif tag == 'attachment': 63 obj.attachment = DiskAttachmentReader.read_one(reader) 64 elif tag == 'authorized_key': 65 obj.authorized_key = AuthorizedKeyReader.read_one(reader) 66 elif tag == 'auto_pinning_policy': 67 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 68 elif tag == 'bricks': 69 obj.bricks = GlusterBrickReader.read_many(reader) 70 elif tag == 'certificates': 71 obj.certificates = CertificateReader.read_many(reader) 72 elif tag == 'check_connectivity': 73 obj.check_connectivity = Reader.read_boolean(reader) 74 elif tag == 'clone': 75 obj.clone = Reader.read_boolean(reader) 76 elif tag == 'clone_permissions': 77 obj.clone_permissions = Reader.read_boolean(reader) 78 elif tag == 'cluster': 79 obj.cluster = ClusterReader.read_one(reader) 80 elif tag == 'collapse_snapshots': 81 obj.collapse_snapshots = Reader.read_boolean(reader) 82 elif tag == 'comment': 83 obj.comment = Reader.read_string(reader) 84 elif tag == 'commit_on_success': 85 obj.commit_on_success = Reader.read_boolean(reader) 86 elif tag == 'connection': 87 obj.connection = StorageConnectionReader.read_one(reader) 88 elif tag == 'connectivity_timeout': 89 obj.connectivity_timeout = Reader.read_integer(reader) 90 elif tag == 'correlation_id': 91 obj.correlation_id = Reader.read_string(reader) 92 elif tag == 'data_center': 93 obj.data_center = DataCenterReader.read_one(reader) 94 elif tag == 'deploy_hosted_engine': 95 obj.deploy_hosted_engine = Reader.read_boolean(reader) 96 elif tag == 'description': 97 obj.description = Reader.read_string(reader) 98 elif tag == 'details': 99 obj.details = GlusterVolumeProfileDetailsReader.read_one(reader) 100 elif tag == 'directory': 101 obj.directory = Reader.read_string(reader) 102 elif tag == 'discard_snapshots': 103 obj.discard_snapshots = Reader.read_boolean(reader) 104 elif tag == 'discovered_targets': 105 obj.discovered_targets = IscsiDetailsReader.read_many(reader) 106 elif tag == 'disk': 107 obj.disk = DiskReader.read_one(reader) 108 elif tag == 'disk_profile': 109 obj.disk_profile = DiskProfileReader.read_one(reader) 110 elif tag == 'disks': 111 obj.disks = DiskReader.read_many(reader) 112 elif tag == 'exclusive': 113 obj.exclusive = Reader.read_boolean(reader) 114 elif tag == 'fault': 115 obj.fault = FaultReader.read_one(reader) 116 elif tag == 'fence_type': 117 obj.fence_type = Reader.read_string(reader) 118 elif tag == 'filename': 119 obj.filename = Reader.read_string(reader) 120 elif tag == 'filter': 121 obj.filter = Reader.read_boolean(reader) 122 elif tag == 'fix_layout': 123 obj.fix_layout = Reader.read_boolean(reader) 124 elif tag == 'follow': 125 obj.follow = Reader.read_string(reader) 126 elif tag == 'force': 127 obj.force = Reader.read_boolean(reader) 128 elif tag == 'grace_period': 129 obj.grace_period = GracePeriodReader.read_one(reader) 130 elif tag == 'host': 131 obj.host = HostReader.read_one(reader) 132 elif tag == 'image': 133 obj.image = Reader.read_string(reader) 134 elif tag == 'image_transfer': 135 obj.image_transfer = ImageTransferReader.read_one(reader) 136 elif tag == 'import_as_template': 137 obj.import_as_template = Reader.read_boolean(reader) 138 elif tag == 'is_attached': 139 obj.is_attached = Reader.read_boolean(reader) 140 elif tag == 'iscsi': 141 obj.iscsi = IscsiDetailsReader.read_one(reader) 142 elif tag == 'iscsi_targets': 143 obj.iscsi_targets = Reader.read_strings(reader) 144 elif tag == 'job': 145 obj.job = JobReader.read_one(reader) 146 elif tag == 'lease': 147 obj.lease = StorageDomainLeaseReader.read_one(reader) 148 elif tag == 'logical_units': 149 obj.logical_units = LogicalUnitReader.read_many(reader) 150 elif tag == 'maintenance_after_restart': 151 obj.maintenance_after_restart = Reader.read_boolean(reader) 152 elif tag == 'maintenance_enabled': 153 obj.maintenance_enabled = Reader.read_boolean(reader) 154 elif tag == 'migrate_vms_in_affinity_closure': 155 obj.migrate_vms_in_affinity_closure = Reader.read_boolean(reader) 156 elif tag == 'modified_bonds': 157 obj.modified_bonds = HostNicReader.read_many(reader) 158 elif tag == 'modified_labels': 159 obj.modified_labels = NetworkLabelReader.read_many(reader) 160 elif tag == 'modified_network_attachments': 161 obj.modified_network_attachments = NetworkAttachmentReader.read_many(reader) 162 elif tag == 'name': 163 obj.name = Reader.read_string(reader) 164 elif tag == 'optimize_cpu_settings': 165 obj.optimize_cpu_settings = Reader.read_boolean(reader) 166 elif tag == 'option': 167 obj.option = OptionReader.read_one(reader) 168 elif tag == 'pause': 169 obj.pause = Reader.read_boolean(reader) 170 elif tag == 'permission': 171 obj.permission = PermissionReader.read_one(reader) 172 elif tag == 'power_management': 173 obj.power_management = PowerManagementReader.read_one(reader) 174 elif tag == 'proxy_ticket': 175 obj.proxy_ticket = ProxyTicketReader.read_one(reader) 176 elif tag == 'quota': 177 obj.quota = QuotaReader.read_one(reader) 178 elif tag == 'reason': 179 obj.reason = Reader.read_string(reader) 180 elif tag == 'reassign_bad_macs': 181 obj.reassign_bad_macs = Reader.read_boolean(reader) 182 elif tag == 'reboot': 183 obj.reboot = Reader.read_boolean(reader) 184 elif tag == 'registration_configuration': 185 obj.registration_configuration = RegistrationConfigurationReader.read_one(reader) 186 elif tag == 'remote_viewer_connection_file': 187 obj.remote_viewer_connection_file = Reader.read_string(reader) 188 elif tag == 'removed_bonds': 189 obj.removed_bonds = HostNicReader.read_many(reader) 190 elif tag == 'removed_labels': 191 obj.removed_labels = NetworkLabelReader.read_many(reader) 192 elif tag == 'removed_network_attachments': 193 obj.removed_network_attachments = NetworkAttachmentReader.read_many(reader) 194 elif tag == 'resolution_type': 195 obj.resolution_type = Reader.read_string(reader) 196 elif tag == 'restore_memory': 197 obj.restore_memory = Reader.read_boolean(reader) 198 elif tag == 'root_password': 199 obj.root_password = Reader.read_string(reader) 200 elif tag == 'seal': 201 obj.seal = Reader.read_boolean(reader) 202 elif tag == 'snapshot': 203 obj.snapshot = SnapshotReader.read_one(reader) 204 elif tag == 'source_host': 205 obj.source_host = HostReader.read_one(reader) 206 elif tag == 'ssh': 207 obj.ssh = SshReader.read_one(reader) 208 elif tag == 'status': 209 obj.status = Reader.read_string(reader) 210 elif tag == 'stop_gluster_service': 211 obj.stop_gluster_service = Reader.read_boolean(reader) 212 elif tag == 'storage_domain': 213 obj.storage_domain = StorageDomainReader.read_one(reader) 214 elif tag == 'storage_domains': 215 obj.storage_domains = StorageDomainReader.read_many(reader) 216 elif tag == 'succeeded': 217 obj.succeeded = Reader.read_boolean(reader) 218 elif tag == 'synchronized_network_attachments': 219 obj.synchronized_network_attachments = NetworkAttachmentReader.read_many(reader) 220 elif tag == 'template': 221 obj.template = TemplateReader.read_one(reader) 222 elif tag == 'ticket': 223 obj.ticket = TicketReader.read_one(reader) 224 elif tag == 'timeout': 225 obj.timeout = Reader.read_integer(reader) 226 elif tag == 'undeploy_hosted_engine': 227 obj.undeploy_hosted_engine = Reader.read_boolean(reader) 228 elif tag == 'upgrade_action': 229 obj.upgrade_action = Reader.read_enum(types.ClusterUpgradeAction, reader) 230 elif tag == 'upgrade_percent_complete': 231 obj.upgrade_percent_complete = Reader.read_integer(reader) 232 elif tag == 'use_cloud_init': 233 obj.use_cloud_init = Reader.read_boolean(reader) 234 elif tag == 'use_ignition': 235 obj.use_ignition = Reader.read_boolean(reader) 236 elif tag == 'use_initialization': 237 obj.use_initialization = Reader.read_boolean(reader) 238 elif tag == 'use_sysprep': 239 obj.use_sysprep = Reader.read_boolean(reader) 240 elif tag == 'virtual_functions_configuration': 241 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 242 elif tag == 'vm': 243 obj.vm = VmReader.read_one(reader) 244 elif tag == 'vnic_profile_mappings': 245 obj.vnic_profile_mappings = VnicProfileMappingReader.read_many(reader) 246 elif tag == 'volatile': 247 obj.volatile = Reader.read_boolean(reader) 248 else: 249 reader.next_element() 250 for link in links: 251 ActionReader._process_link(link, obj) 252 253 # Discard the end tag: 254 reader.read() 255 256 return obj
258 @staticmethod 259 def read_many(reader): 260 # Do nothing if there aren't more tags: 261 objs = List() 262 if not reader.forward(): 263 return objs 264 265 # Process the attributes: 266 objs.href = reader.get_attribute('href') 267 268 # Discard the start tag: 269 empty = reader.empty_element() 270 reader.read() 271 if empty: 272 return objs 273 274 # Process the inner elements: 275 while reader.forward(): 276 objs.append(ActionReader.read_one(reader)) 277 278 # Discard the end tag: 279 reader.read() 280 281 return objs
284class AffinityGroupReader(Reader): 285 286 def __init__(self): 287 super(AffinityGroupReader, self).__init__() 288 289 @staticmethod 290 def read_one(reader): 291 # Do nothing if there aren't more tags: 292 if not reader.forward(): 293 return None 294 295 # Create the object: 296 obj = types.AffinityGroup() 297 298 # Process the attributes: 299 obj.href = reader.get_attribute('href') 300 value = reader.get_attribute('id') 301 if value is not None: 302 obj.id = value 303 304 # Discard the start tag: 305 empty = reader.empty_element() 306 reader.read() 307 if empty: 308 return obj 309 310 # Process the inner elements: 311 links = [] 312 while reader.forward(): 313 tag = reader.node_name() 314 if tag == 'broken': 315 obj.broken = Reader.read_boolean(reader) 316 elif tag == 'cluster': 317 obj.cluster = ClusterReader.read_one(reader) 318 elif tag == 'comment': 319 obj.comment = Reader.read_string(reader) 320 elif tag == 'description': 321 obj.description = Reader.read_string(reader) 322 elif tag == 'enforcing': 323 obj.enforcing = Reader.read_boolean(reader) 324 elif tag == 'host_labels': 325 obj.host_labels = AffinityLabelReader.read_many(reader) 326 elif tag == 'hosts': 327 obj.hosts = HostReader.read_many(reader) 328 elif tag == 'hosts_rule': 329 obj.hosts_rule = AffinityRuleReader.read_one(reader) 330 elif tag == 'name': 331 obj.name = Reader.read_string(reader) 332 elif tag == 'positive': 333 obj.positive = Reader.read_boolean(reader) 334 elif tag == 'priority': 335 obj.priority = Reader.read_decimal(reader) 336 elif tag == 'vm_labels': 337 obj.vm_labels = AffinityLabelReader.read_many(reader) 338 elif tag == 'vms': 339 obj.vms = VmReader.read_many(reader) 340 elif tag == 'vms_rule': 341 obj.vms_rule = AffinityRuleReader.read_one(reader) 342 elif tag == 'link': 343 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 344 reader.next_element() 345 else: 346 reader.next_element() 347 for link in links: 348 AffinityGroupReader._process_link(link, obj) 349 350 # Discard the end tag: 351 reader.read() 352 353 return obj 354 355 @staticmethod 356 def read_many(reader): 357 # Do nothing if there aren't more tags: 358 objs = List() 359 if not reader.forward(): 360 return objs 361 362 # Process the attributes: 363 objs.href = reader.get_attribute('href') 364 365 # Discard the start tag: 366 empty = reader.empty_element() 367 reader.read() 368 if empty: 369 return objs 370 371 # Process the inner elements: 372 while reader.forward(): 373 objs.append(AffinityGroupReader.read_one(reader)) 374 375 # Discard the end tag: 376 reader.read() 377 378 return objs 379 380 @staticmethod 381 def _process_link(link, obj): 382 # Process the attributes: 383 rel = link[0] 384 href = link[1] 385 if href and rel: 386 if rel == "hostlabels": 387 if obj.host_labels is not None: 388 obj.host_labels.href = href 389 else: 390 obj.host_labels = List(href) 391 elif rel == "hosts": 392 if obj.hosts is not None: 393 obj.hosts.href = href 394 else: 395 obj.hosts = List(href) 396 elif rel == "vmlabels": 397 if obj.vm_labels is not None: 398 obj.vm_labels.href = href 399 else: 400 obj.vm_labels = List(href) 401 elif rel == "vms": 402 if obj.vms is not None: 403 obj.vms.href = href 404 else: 405 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
289 @staticmethod 290 def read_one(reader): 291 # Do nothing if there aren't more tags: 292 if not reader.forward(): 293 return None 294 295 # Create the object: 296 obj = types.AffinityGroup() 297 298 # Process the attributes: 299 obj.href = reader.get_attribute('href') 300 value = reader.get_attribute('id') 301 if value is not None: 302 obj.id = value 303 304 # Discard the start tag: 305 empty = reader.empty_element() 306 reader.read() 307 if empty: 308 return obj 309 310 # Process the inner elements: 311 links = [] 312 while reader.forward(): 313 tag = reader.node_name() 314 if tag == 'broken': 315 obj.broken = Reader.read_boolean(reader) 316 elif tag == 'cluster': 317 obj.cluster = ClusterReader.read_one(reader) 318 elif tag == 'comment': 319 obj.comment = Reader.read_string(reader) 320 elif tag == 'description': 321 obj.description = Reader.read_string(reader) 322 elif tag == 'enforcing': 323 obj.enforcing = Reader.read_boolean(reader) 324 elif tag == 'host_labels': 325 obj.host_labels = AffinityLabelReader.read_many(reader) 326 elif tag == 'hosts': 327 obj.hosts = HostReader.read_many(reader) 328 elif tag == 'hosts_rule': 329 obj.hosts_rule = AffinityRuleReader.read_one(reader) 330 elif tag == 'name': 331 obj.name = Reader.read_string(reader) 332 elif tag == 'positive': 333 obj.positive = Reader.read_boolean(reader) 334 elif tag == 'priority': 335 obj.priority = Reader.read_decimal(reader) 336 elif tag == 'vm_labels': 337 obj.vm_labels = AffinityLabelReader.read_many(reader) 338 elif tag == 'vms': 339 obj.vms = VmReader.read_many(reader) 340 elif tag == 'vms_rule': 341 obj.vms_rule = AffinityRuleReader.read_one(reader) 342 elif tag == 'link': 343 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 344 reader.next_element() 345 else: 346 reader.next_element() 347 for link in links: 348 AffinityGroupReader._process_link(link, obj) 349 350 # Discard the end tag: 351 reader.read() 352 353 return obj
355 @staticmethod 356 def read_many(reader): 357 # Do nothing if there aren't more tags: 358 objs = List() 359 if not reader.forward(): 360 return objs 361 362 # Process the attributes: 363 objs.href = reader.get_attribute('href') 364 365 # Discard the start tag: 366 empty = reader.empty_element() 367 reader.read() 368 if empty: 369 return objs 370 371 # Process the inner elements: 372 while reader.forward(): 373 objs.append(AffinityGroupReader.read_one(reader)) 374 375 # Discard the end tag: 376 reader.read() 377 378 return objs
408class AffinityLabelReader(Reader): 409 410 def __init__(self): 411 super(AffinityLabelReader, self).__init__() 412 413 @staticmethod 414 def read_one(reader): 415 # Do nothing if there aren't more tags: 416 if not reader.forward(): 417 return None 418 419 # Create the object: 420 obj = types.AffinityLabel() 421 422 # Process the attributes: 423 obj.href = reader.get_attribute('href') 424 value = reader.get_attribute('id') 425 if value is not None: 426 obj.id = value 427 428 # Discard the start tag: 429 empty = reader.empty_element() 430 reader.read() 431 if empty: 432 return obj 433 434 # Process the inner elements: 435 links = [] 436 while reader.forward(): 437 tag = reader.node_name() 438 if tag == 'comment': 439 obj.comment = Reader.read_string(reader) 440 elif tag == 'description': 441 obj.description = Reader.read_string(reader) 442 elif tag == 'has_implicit_affinity_group': 443 obj.has_implicit_affinity_group = Reader.read_boolean(reader) 444 elif tag == 'hosts': 445 obj.hosts = HostReader.read_many(reader) 446 elif tag == 'name': 447 obj.name = Reader.read_string(reader) 448 elif tag == 'read_only': 449 obj.read_only = Reader.read_boolean(reader) 450 elif tag == 'vms': 451 obj.vms = VmReader.read_many(reader) 452 elif tag == 'link': 453 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 454 reader.next_element() 455 else: 456 reader.next_element() 457 for link in links: 458 AffinityLabelReader._process_link(link, obj) 459 460 # Discard the end tag: 461 reader.read() 462 463 return obj 464 465 @staticmethod 466 def read_many(reader): 467 # Do nothing if there aren't more tags: 468 objs = List() 469 if not reader.forward(): 470 return objs 471 472 # Process the attributes: 473 objs.href = reader.get_attribute('href') 474 475 # Discard the start tag: 476 empty = reader.empty_element() 477 reader.read() 478 if empty: 479 return objs 480 481 # Process the inner elements: 482 while reader.forward(): 483 objs.append(AffinityLabelReader.read_one(reader)) 484 485 # Discard the end tag: 486 reader.read() 487 488 return objs 489 490 @staticmethod 491 def _process_link(link, obj): 492 # Process the attributes: 493 rel = link[0] 494 href = link[1] 495 if href and rel: 496 if rel == "hosts": 497 if obj.hosts is not None: 498 obj.hosts.href = href 499 else: 500 obj.hosts = List(href) 501 elif rel == "vms": 502 if obj.vms is not None: 503 obj.vms.href = href 504 else: 505 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
413 @staticmethod 414 def read_one(reader): 415 # Do nothing if there aren't more tags: 416 if not reader.forward(): 417 return None 418 419 # Create the object: 420 obj = types.AffinityLabel() 421 422 # Process the attributes: 423 obj.href = reader.get_attribute('href') 424 value = reader.get_attribute('id') 425 if value is not None: 426 obj.id = value 427 428 # Discard the start tag: 429 empty = reader.empty_element() 430 reader.read() 431 if empty: 432 return obj 433 434 # Process the inner elements: 435 links = [] 436 while reader.forward(): 437 tag = reader.node_name() 438 if tag == 'comment': 439 obj.comment = Reader.read_string(reader) 440 elif tag == 'description': 441 obj.description = Reader.read_string(reader) 442 elif tag == 'has_implicit_affinity_group': 443 obj.has_implicit_affinity_group = Reader.read_boolean(reader) 444 elif tag == 'hosts': 445 obj.hosts = HostReader.read_many(reader) 446 elif tag == 'name': 447 obj.name = Reader.read_string(reader) 448 elif tag == 'read_only': 449 obj.read_only = Reader.read_boolean(reader) 450 elif tag == 'vms': 451 obj.vms = VmReader.read_many(reader) 452 elif tag == 'link': 453 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 454 reader.next_element() 455 else: 456 reader.next_element() 457 for link in links: 458 AffinityLabelReader._process_link(link, obj) 459 460 # Discard the end tag: 461 reader.read() 462 463 return obj
465 @staticmethod 466 def read_many(reader): 467 # Do nothing if there aren't more tags: 468 objs = List() 469 if not reader.forward(): 470 return objs 471 472 # Process the attributes: 473 objs.href = reader.get_attribute('href') 474 475 # Discard the start tag: 476 empty = reader.empty_element() 477 reader.read() 478 if empty: 479 return objs 480 481 # Process the inner elements: 482 while reader.forward(): 483 objs.append(AffinityLabelReader.read_one(reader)) 484 485 # Discard the end tag: 486 reader.read() 487 488 return objs
508class AffinityRuleReader(Reader): 509 510 def __init__(self): 511 super(AffinityRuleReader, self).__init__() 512 513 @staticmethod 514 def read_one(reader): 515 # Do nothing if there aren't more tags: 516 if not reader.forward(): 517 return None 518 519 # Create the object: 520 obj = types.AffinityRule() 521 522 # Process the attributes: 523 obj.href = reader.get_attribute('href') 524 525 # Discard the start tag: 526 empty = reader.empty_element() 527 reader.read() 528 if empty: 529 return obj 530 531 # Process the inner elements: 532 links = [] 533 while reader.forward(): 534 tag = reader.node_name() 535 if tag == 'enabled': 536 obj.enabled = Reader.read_boolean(reader) 537 elif tag == 'enforcing': 538 obj.enforcing = Reader.read_boolean(reader) 539 elif tag == 'positive': 540 obj.positive = Reader.read_boolean(reader) 541 else: 542 reader.next_element() 543 for link in links: 544 AffinityRuleReader._process_link(link, obj) 545 546 # Discard the end tag: 547 reader.read() 548 549 return obj 550 551 @staticmethod 552 def read_many(reader): 553 # Do nothing if there aren't more tags: 554 objs = List() 555 if not reader.forward(): 556 return objs 557 558 # Process the attributes: 559 objs.href = reader.get_attribute('href') 560 561 # Discard the start tag: 562 empty = reader.empty_element() 563 reader.read() 564 if empty: 565 return objs 566 567 # Process the inner elements: 568 while reader.forward(): 569 objs.append(AffinityRuleReader.read_one(reader)) 570 571 # Discard the end tag: 572 reader.read() 573 574 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
513 @staticmethod 514 def read_one(reader): 515 # Do nothing if there aren't more tags: 516 if not reader.forward(): 517 return None 518 519 # Create the object: 520 obj = types.AffinityRule() 521 522 # Process the attributes: 523 obj.href = reader.get_attribute('href') 524 525 # Discard the start tag: 526 empty = reader.empty_element() 527 reader.read() 528 if empty: 529 return obj 530 531 # Process the inner elements: 532 links = [] 533 while reader.forward(): 534 tag = reader.node_name() 535 if tag == 'enabled': 536 obj.enabled = Reader.read_boolean(reader) 537 elif tag == 'enforcing': 538 obj.enforcing = Reader.read_boolean(reader) 539 elif tag == 'positive': 540 obj.positive = Reader.read_boolean(reader) 541 else: 542 reader.next_element() 543 for link in links: 544 AffinityRuleReader._process_link(link, obj) 545 546 # Discard the end tag: 547 reader.read() 548 549 return obj
551 @staticmethod 552 def read_many(reader): 553 # Do nothing if there aren't more tags: 554 objs = List() 555 if not reader.forward(): 556 return objs 557 558 # Process the attributes: 559 objs.href = reader.get_attribute('href') 560 561 # Discard the start tag: 562 empty = reader.empty_element() 563 reader.read() 564 if empty: 565 return objs 566 567 # Process the inner elements: 568 while reader.forward(): 569 objs.append(AffinityRuleReader.read_one(reader)) 570 571 # Discard the end tag: 572 reader.read() 573 574 return objs
577class AgentReader(Reader): 578 579 def __init__(self): 580 super(AgentReader, self).__init__() 581 582 @staticmethod 583 def read_one(reader): 584 # Do nothing if there aren't more tags: 585 if not reader.forward(): 586 return None 587 588 # Create the object: 589 obj = types.Agent() 590 591 # Process the attributes: 592 obj.href = reader.get_attribute('href') 593 value = reader.get_attribute('id') 594 if value is not None: 595 obj.id = value 596 597 # Discard the start tag: 598 empty = reader.empty_element() 599 reader.read() 600 if empty: 601 return obj 602 603 # Process the inner elements: 604 links = [] 605 while reader.forward(): 606 tag = reader.node_name() 607 if tag == 'address': 608 obj.address = Reader.read_string(reader) 609 elif tag == 'comment': 610 obj.comment = Reader.read_string(reader) 611 elif tag == 'concurrent': 612 obj.concurrent = Reader.read_boolean(reader) 613 elif tag == 'description': 614 obj.description = Reader.read_string(reader) 615 elif tag == 'encrypt_options': 616 obj.encrypt_options = Reader.read_boolean(reader) 617 elif tag == 'host': 618 obj.host = HostReader.read_one(reader) 619 elif tag == 'name': 620 obj.name = Reader.read_string(reader) 621 elif tag == 'options': 622 obj.options = OptionReader.read_many(reader) 623 elif tag == 'order': 624 obj.order = Reader.read_integer(reader) 625 elif tag == 'password': 626 obj.password = Reader.read_string(reader) 627 elif tag == 'port': 628 obj.port = Reader.read_integer(reader) 629 elif tag == 'type': 630 obj.type = Reader.read_string(reader) 631 elif tag == 'username': 632 obj.username = Reader.read_string(reader) 633 else: 634 reader.next_element() 635 for link in links: 636 AgentReader._process_link(link, obj) 637 638 # Discard the end tag: 639 reader.read() 640 641 return obj 642 643 @staticmethod 644 def read_many(reader): 645 # Do nothing if there aren't more tags: 646 objs = List() 647 if not reader.forward(): 648 return objs 649 650 # Process the attributes: 651 objs.href = reader.get_attribute('href') 652 653 # Discard the start tag: 654 empty = reader.empty_element() 655 reader.read() 656 if empty: 657 return objs 658 659 # Process the inner elements: 660 while reader.forward(): 661 objs.append(AgentReader.read_one(reader)) 662 663 # Discard the end tag: 664 reader.read() 665 666 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
582 @staticmethod 583 def read_one(reader): 584 # Do nothing if there aren't more tags: 585 if not reader.forward(): 586 return None 587 588 # Create the object: 589 obj = types.Agent() 590 591 # Process the attributes: 592 obj.href = reader.get_attribute('href') 593 value = reader.get_attribute('id') 594 if value is not None: 595 obj.id = value 596 597 # Discard the start tag: 598 empty = reader.empty_element() 599 reader.read() 600 if empty: 601 return obj 602 603 # Process the inner elements: 604 links = [] 605 while reader.forward(): 606 tag = reader.node_name() 607 if tag == 'address': 608 obj.address = Reader.read_string(reader) 609 elif tag == 'comment': 610 obj.comment = Reader.read_string(reader) 611 elif tag == 'concurrent': 612 obj.concurrent = Reader.read_boolean(reader) 613 elif tag == 'description': 614 obj.description = Reader.read_string(reader) 615 elif tag == 'encrypt_options': 616 obj.encrypt_options = Reader.read_boolean(reader) 617 elif tag == 'host': 618 obj.host = HostReader.read_one(reader) 619 elif tag == 'name': 620 obj.name = Reader.read_string(reader) 621 elif tag == 'options': 622 obj.options = OptionReader.read_many(reader) 623 elif tag == 'order': 624 obj.order = Reader.read_integer(reader) 625 elif tag == 'password': 626 obj.password = Reader.read_string(reader) 627 elif tag == 'port': 628 obj.port = Reader.read_integer(reader) 629 elif tag == 'type': 630 obj.type = Reader.read_string(reader) 631 elif tag == 'username': 632 obj.username = Reader.read_string(reader) 633 else: 634 reader.next_element() 635 for link in links: 636 AgentReader._process_link(link, obj) 637 638 # Discard the end tag: 639 reader.read() 640 641 return obj
643 @staticmethod 644 def read_many(reader): 645 # Do nothing if there aren't more tags: 646 objs = List() 647 if not reader.forward(): 648 return objs 649 650 # Process the attributes: 651 objs.href = reader.get_attribute('href') 652 653 # Discard the start tag: 654 empty = reader.empty_element() 655 reader.read() 656 if empty: 657 return objs 658 659 # Process the inner elements: 660 while reader.forward(): 661 objs.append(AgentReader.read_one(reader)) 662 663 # Discard the end tag: 664 reader.read() 665 666 return objs
669class AgentConfigurationReader(Reader): 670 671 def __init__(self): 672 super(AgentConfigurationReader, self).__init__() 673 674 @staticmethod 675 def read_one(reader): 676 # Do nothing if there aren't more tags: 677 if not reader.forward(): 678 return None 679 680 # Create the object: 681 obj = types.AgentConfiguration() 682 683 # Process the attributes: 684 obj.href = reader.get_attribute('href') 685 686 # Discard the start tag: 687 empty = reader.empty_element() 688 reader.read() 689 if empty: 690 return obj 691 692 # Process the inner elements: 693 links = [] 694 while reader.forward(): 695 tag = reader.node_name() 696 if tag == 'address': 697 obj.address = Reader.read_string(reader) 698 elif tag == 'broker_type': 699 obj.broker_type = Reader.read_enum(types.MessageBrokerType, reader) 700 elif tag == 'network_mappings': 701 obj.network_mappings = Reader.read_string(reader) 702 elif tag == 'password': 703 obj.password = Reader.read_string(reader) 704 elif tag == 'port': 705 obj.port = Reader.read_integer(reader) 706 elif tag == 'username': 707 obj.username = Reader.read_string(reader) 708 else: 709 reader.next_element() 710 for link in links: 711 AgentConfigurationReader._process_link(link, obj) 712 713 # Discard the end tag: 714 reader.read() 715 716 return obj 717 718 @staticmethod 719 def read_many(reader): 720 # Do nothing if there aren't more tags: 721 objs = List() 722 if not reader.forward(): 723 return objs 724 725 # Process the attributes: 726 objs.href = reader.get_attribute('href') 727 728 # Discard the start tag: 729 empty = reader.empty_element() 730 reader.read() 731 if empty: 732 return objs 733 734 # Process the inner elements: 735 while reader.forward(): 736 objs.append(AgentConfigurationReader.read_one(reader)) 737 738 # Discard the end tag: 739 reader.read() 740 741 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
674 @staticmethod 675 def read_one(reader): 676 # Do nothing if there aren't more tags: 677 if not reader.forward(): 678 return None 679 680 # Create the object: 681 obj = types.AgentConfiguration() 682 683 # Process the attributes: 684 obj.href = reader.get_attribute('href') 685 686 # Discard the start tag: 687 empty = reader.empty_element() 688 reader.read() 689 if empty: 690 return obj 691 692 # Process the inner elements: 693 links = [] 694 while reader.forward(): 695 tag = reader.node_name() 696 if tag == 'address': 697 obj.address = Reader.read_string(reader) 698 elif tag == 'broker_type': 699 obj.broker_type = Reader.read_enum(types.MessageBrokerType, reader) 700 elif tag == 'network_mappings': 701 obj.network_mappings = Reader.read_string(reader) 702 elif tag == 'password': 703 obj.password = Reader.read_string(reader) 704 elif tag == 'port': 705 obj.port = Reader.read_integer(reader) 706 elif tag == 'username': 707 obj.username = Reader.read_string(reader) 708 else: 709 reader.next_element() 710 for link in links: 711 AgentConfigurationReader._process_link(link, obj) 712 713 # Discard the end tag: 714 reader.read() 715 716 return obj
718 @staticmethod 719 def read_many(reader): 720 # Do nothing if there aren't more tags: 721 objs = List() 722 if not reader.forward(): 723 return objs 724 725 # Process the attributes: 726 objs.href = reader.get_attribute('href') 727 728 # Discard the start tag: 729 empty = reader.empty_element() 730 reader.read() 731 if empty: 732 return objs 733 734 # Process the inner elements: 735 while reader.forward(): 736 objs.append(AgentConfigurationReader.read_one(reader)) 737 738 # Discard the end tag: 739 reader.read() 740 741 return objs
744class ApiReader(Reader): 745 746 def __init__(self): 747 super(ApiReader, self).__init__() 748 749 @staticmethod 750 def read_one(reader): 751 # Do nothing if there aren't more tags: 752 if not reader.forward(): 753 return None 754 755 # Create the object: 756 obj = types.Api() 757 758 # Process the attributes: 759 obj.href = reader.get_attribute('href') 760 761 # Discard the start tag: 762 empty = reader.empty_element() 763 reader.read() 764 if empty: 765 return obj 766 767 # Process the inner elements: 768 links = [] 769 while reader.forward(): 770 tag = reader.node_name() 771 if tag == 'authenticated_user': 772 obj.authenticated_user = UserReader.read_one(reader) 773 elif tag == 'effective_user': 774 obj.effective_user = UserReader.read_one(reader) 775 elif tag == 'product_info': 776 obj.product_info = ProductInfoReader.read_one(reader) 777 elif tag == 'special_objects': 778 obj.special_objects = SpecialObjectsReader.read_one(reader) 779 elif tag == 'summary': 780 obj.summary = ApiSummaryReader.read_one(reader) 781 elif tag == 'time': 782 obj.time = Reader.read_date(reader) 783 else: 784 reader.next_element() 785 for link in links: 786 ApiReader._process_link(link, obj) 787 788 # Discard the end tag: 789 reader.read() 790 791 return obj 792 793 @staticmethod 794 def read_many(reader): 795 # Do nothing if there aren't more tags: 796 objs = List() 797 if not reader.forward(): 798 return objs 799 800 # Process the attributes: 801 objs.href = reader.get_attribute('href') 802 803 # Discard the start tag: 804 empty = reader.empty_element() 805 reader.read() 806 if empty: 807 return objs 808 809 # Process the inner elements: 810 while reader.forward(): 811 objs.append(ApiReader.read_one(reader)) 812 813 # Discard the end tag: 814 reader.read() 815 816 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
749 @staticmethod 750 def read_one(reader): 751 # Do nothing if there aren't more tags: 752 if not reader.forward(): 753 return None 754 755 # Create the object: 756 obj = types.Api() 757 758 # Process the attributes: 759 obj.href = reader.get_attribute('href') 760 761 # Discard the start tag: 762 empty = reader.empty_element() 763 reader.read() 764 if empty: 765 return obj 766 767 # Process the inner elements: 768 links = [] 769 while reader.forward(): 770 tag = reader.node_name() 771 if tag == 'authenticated_user': 772 obj.authenticated_user = UserReader.read_one(reader) 773 elif tag == 'effective_user': 774 obj.effective_user = UserReader.read_one(reader) 775 elif tag == 'product_info': 776 obj.product_info = ProductInfoReader.read_one(reader) 777 elif tag == 'special_objects': 778 obj.special_objects = SpecialObjectsReader.read_one(reader) 779 elif tag == 'summary': 780 obj.summary = ApiSummaryReader.read_one(reader) 781 elif tag == 'time': 782 obj.time = Reader.read_date(reader) 783 else: 784 reader.next_element() 785 for link in links: 786 ApiReader._process_link(link, obj) 787 788 # Discard the end tag: 789 reader.read() 790 791 return obj
793 @staticmethod 794 def read_many(reader): 795 # Do nothing if there aren't more tags: 796 objs = List() 797 if not reader.forward(): 798 return objs 799 800 # Process the attributes: 801 objs.href = reader.get_attribute('href') 802 803 # Discard the start tag: 804 empty = reader.empty_element() 805 reader.read() 806 if empty: 807 return objs 808 809 # Process the inner elements: 810 while reader.forward(): 811 objs.append(ApiReader.read_one(reader)) 812 813 # Discard the end tag: 814 reader.read() 815 816 return objs
819class ApiSummaryReader(Reader): 820 821 def __init__(self): 822 super(ApiSummaryReader, self).__init__() 823 824 @staticmethod 825 def read_one(reader): 826 # Do nothing if there aren't more tags: 827 if not reader.forward(): 828 return None 829 830 # Create the object: 831 obj = types.ApiSummary() 832 833 # Process the attributes: 834 obj.href = reader.get_attribute('href') 835 836 # Discard the start tag: 837 empty = reader.empty_element() 838 reader.read() 839 if empty: 840 return obj 841 842 # Process the inner elements: 843 links = [] 844 while reader.forward(): 845 tag = reader.node_name() 846 if tag == 'hosts': 847 obj.hosts = ApiSummaryItemReader.read_one(reader) 848 elif tag == 'storage_domains': 849 obj.storage_domains = ApiSummaryItemReader.read_one(reader) 850 elif tag == 'users': 851 obj.users = ApiSummaryItemReader.read_one(reader) 852 elif tag == 'vms': 853 obj.vms = ApiSummaryItemReader.read_one(reader) 854 else: 855 reader.next_element() 856 for link in links: 857 ApiSummaryReader._process_link(link, obj) 858 859 # Discard the end tag: 860 reader.read() 861 862 return obj 863 864 @staticmethod 865 def read_many(reader): 866 # Do nothing if there aren't more tags: 867 objs = List() 868 if not reader.forward(): 869 return objs 870 871 # Process the attributes: 872 objs.href = reader.get_attribute('href') 873 874 # Discard the start tag: 875 empty = reader.empty_element() 876 reader.read() 877 if empty: 878 return objs 879 880 # Process the inner elements: 881 while reader.forward(): 882 objs.append(ApiSummaryReader.read_one(reader)) 883 884 # Discard the end tag: 885 reader.read() 886 887 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
824 @staticmethod 825 def read_one(reader): 826 # Do nothing if there aren't more tags: 827 if not reader.forward(): 828 return None 829 830 # Create the object: 831 obj = types.ApiSummary() 832 833 # Process the attributes: 834 obj.href = reader.get_attribute('href') 835 836 # Discard the start tag: 837 empty = reader.empty_element() 838 reader.read() 839 if empty: 840 return obj 841 842 # Process the inner elements: 843 links = [] 844 while reader.forward(): 845 tag = reader.node_name() 846 if tag == 'hosts': 847 obj.hosts = ApiSummaryItemReader.read_one(reader) 848 elif tag == 'storage_domains': 849 obj.storage_domains = ApiSummaryItemReader.read_one(reader) 850 elif tag == 'users': 851 obj.users = ApiSummaryItemReader.read_one(reader) 852 elif tag == 'vms': 853 obj.vms = ApiSummaryItemReader.read_one(reader) 854 else: 855 reader.next_element() 856 for link in links: 857 ApiSummaryReader._process_link(link, obj) 858 859 # Discard the end tag: 860 reader.read() 861 862 return obj
864 @staticmethod 865 def read_many(reader): 866 # Do nothing if there aren't more tags: 867 objs = List() 868 if not reader.forward(): 869 return objs 870 871 # Process the attributes: 872 objs.href = reader.get_attribute('href') 873 874 # Discard the start tag: 875 empty = reader.empty_element() 876 reader.read() 877 if empty: 878 return objs 879 880 # Process the inner elements: 881 while reader.forward(): 882 objs.append(ApiSummaryReader.read_one(reader)) 883 884 # Discard the end tag: 885 reader.read() 886 887 return objs
890class ApiSummaryItemReader(Reader): 891 892 def __init__(self): 893 super(ApiSummaryItemReader, self).__init__() 894 895 @staticmethod 896 def read_one(reader): 897 # Do nothing if there aren't more tags: 898 if not reader.forward(): 899 return None 900 901 # Create the object: 902 obj = types.ApiSummaryItem() 903 904 # Process the attributes: 905 obj.href = reader.get_attribute('href') 906 907 # Discard the start tag: 908 empty = reader.empty_element() 909 reader.read() 910 if empty: 911 return obj 912 913 # Process the inner elements: 914 links = [] 915 while reader.forward(): 916 tag = reader.node_name() 917 if tag == 'active': 918 obj.active = Reader.read_integer(reader) 919 elif tag == 'total': 920 obj.total = Reader.read_integer(reader) 921 else: 922 reader.next_element() 923 for link in links: 924 ApiSummaryItemReader._process_link(link, obj) 925 926 # Discard the end tag: 927 reader.read() 928 929 return obj 930 931 @staticmethod 932 def read_many(reader): 933 # Do nothing if there aren't more tags: 934 objs = List() 935 if not reader.forward(): 936 return objs 937 938 # Process the attributes: 939 objs.href = reader.get_attribute('href') 940 941 # Discard the start tag: 942 empty = reader.empty_element() 943 reader.read() 944 if empty: 945 return objs 946 947 # Process the inner elements: 948 while reader.forward(): 949 objs.append(ApiSummaryItemReader.read_one(reader)) 950 951 # Discard the end tag: 952 reader.read() 953 954 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
895 @staticmethod 896 def read_one(reader): 897 # Do nothing if there aren't more tags: 898 if not reader.forward(): 899 return None 900 901 # Create the object: 902 obj = types.ApiSummaryItem() 903 904 # Process the attributes: 905 obj.href = reader.get_attribute('href') 906 907 # Discard the start tag: 908 empty = reader.empty_element() 909 reader.read() 910 if empty: 911 return obj 912 913 # Process the inner elements: 914 links = [] 915 while reader.forward(): 916 tag = reader.node_name() 917 if tag == 'active': 918 obj.active = Reader.read_integer(reader) 919 elif tag == 'total': 920 obj.total = Reader.read_integer(reader) 921 else: 922 reader.next_element() 923 for link in links: 924 ApiSummaryItemReader._process_link(link, obj) 925 926 # Discard the end tag: 927 reader.read() 928 929 return obj
931 @staticmethod 932 def read_many(reader): 933 # Do nothing if there aren't more tags: 934 objs = List() 935 if not reader.forward(): 936 return objs 937 938 # Process the attributes: 939 objs.href = reader.get_attribute('href') 940 941 # Discard the start tag: 942 empty = reader.empty_element() 943 reader.read() 944 if empty: 945 return objs 946 947 # Process the inner elements: 948 while reader.forward(): 949 objs.append(ApiSummaryItemReader.read_one(reader)) 950 951 # Discard the end tag: 952 reader.read() 953 954 return objs
957class ApplicationReader(Reader): 958 959 def __init__(self): 960 super(ApplicationReader, self).__init__() 961 962 @staticmethod 963 def read_one(reader): 964 # Do nothing if there aren't more tags: 965 if not reader.forward(): 966 return None 967 968 # Create the object: 969 obj = types.Application() 970 971 # Process the attributes: 972 obj.href = reader.get_attribute('href') 973 value = reader.get_attribute('id') 974 if value is not None: 975 obj.id = value 976 977 # Discard the start tag: 978 empty = reader.empty_element() 979 reader.read() 980 if empty: 981 return obj 982 983 # Process the inner elements: 984 links = [] 985 while reader.forward(): 986 tag = reader.node_name() 987 if tag == 'comment': 988 obj.comment = Reader.read_string(reader) 989 elif tag == 'description': 990 obj.description = Reader.read_string(reader) 991 elif tag == 'name': 992 obj.name = Reader.read_string(reader) 993 elif tag == 'vm': 994 obj.vm = VmReader.read_one(reader) 995 else: 996 reader.next_element() 997 for link in links: 998 ApplicationReader._process_link(link, obj) 999 1000 # Discard the end tag: 1001 reader.read() 1002 1003 return obj 1004 1005 @staticmethod 1006 def read_many(reader): 1007 # Do nothing if there aren't more tags: 1008 objs = List() 1009 if not reader.forward(): 1010 return objs 1011 1012 # Process the attributes: 1013 objs.href = reader.get_attribute('href') 1014 1015 # Discard the start tag: 1016 empty = reader.empty_element() 1017 reader.read() 1018 if empty: 1019 return objs 1020 1021 # Process the inner elements: 1022 while reader.forward(): 1023 objs.append(ApplicationReader.read_one(reader)) 1024 1025 # Discard the end tag: 1026 reader.read() 1027 1028 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
962 @staticmethod 963 def read_one(reader): 964 # Do nothing if there aren't more tags: 965 if not reader.forward(): 966 return None 967 968 # Create the object: 969 obj = types.Application() 970 971 # Process the attributes: 972 obj.href = reader.get_attribute('href') 973 value = reader.get_attribute('id') 974 if value is not None: 975 obj.id = value 976 977 # Discard the start tag: 978 empty = reader.empty_element() 979 reader.read() 980 if empty: 981 return obj 982 983 # Process the inner elements: 984 links = [] 985 while reader.forward(): 986 tag = reader.node_name() 987 if tag == 'comment': 988 obj.comment = Reader.read_string(reader) 989 elif tag == 'description': 990 obj.description = Reader.read_string(reader) 991 elif tag == 'name': 992 obj.name = Reader.read_string(reader) 993 elif tag == 'vm': 994 obj.vm = VmReader.read_one(reader) 995 else: 996 reader.next_element() 997 for link in links: 998 ApplicationReader._process_link(link, obj) 999 1000 # Discard the end tag: 1001 reader.read() 1002 1003 return obj
1005 @staticmethod 1006 def read_many(reader): 1007 # Do nothing if there aren't more tags: 1008 objs = List() 1009 if not reader.forward(): 1010 return objs 1011 1012 # Process the attributes: 1013 objs.href = reader.get_attribute('href') 1014 1015 # Discard the start tag: 1016 empty = reader.empty_element() 1017 reader.read() 1018 if empty: 1019 return objs 1020 1021 # Process the inner elements: 1022 while reader.forward(): 1023 objs.append(ApplicationReader.read_one(reader)) 1024 1025 # Discard the end tag: 1026 reader.read() 1027 1028 return objs
1031class AuthorizedKeyReader(Reader): 1032 1033 def __init__(self): 1034 super(AuthorizedKeyReader, self).__init__() 1035 1036 @staticmethod 1037 def read_one(reader): 1038 # Do nothing if there aren't more tags: 1039 if not reader.forward(): 1040 return None 1041 1042 # Create the object: 1043 obj = types.AuthorizedKey() 1044 1045 # Process the attributes: 1046 obj.href = reader.get_attribute('href') 1047 value = reader.get_attribute('id') 1048 if value is not None: 1049 obj.id = value 1050 1051 # Discard the start tag: 1052 empty = reader.empty_element() 1053 reader.read() 1054 if empty: 1055 return obj 1056 1057 # Process the inner elements: 1058 links = [] 1059 while reader.forward(): 1060 tag = reader.node_name() 1061 if tag == 'comment': 1062 obj.comment = Reader.read_string(reader) 1063 elif tag == 'description': 1064 obj.description = Reader.read_string(reader) 1065 elif tag == 'key': 1066 obj.key = Reader.read_string(reader) 1067 elif tag == 'name': 1068 obj.name = Reader.read_string(reader) 1069 elif tag == 'user': 1070 obj.user = UserReader.read_one(reader) 1071 else: 1072 reader.next_element() 1073 for link in links: 1074 AuthorizedKeyReader._process_link(link, obj) 1075 1076 # Discard the end tag: 1077 reader.read() 1078 1079 return obj 1080 1081 @staticmethod 1082 def read_many(reader): 1083 # Do nothing if there aren't more tags: 1084 objs = List() 1085 if not reader.forward(): 1086 return objs 1087 1088 # Process the attributes: 1089 objs.href = reader.get_attribute('href') 1090 1091 # Discard the start tag: 1092 empty = reader.empty_element() 1093 reader.read() 1094 if empty: 1095 return objs 1096 1097 # Process the inner elements: 1098 while reader.forward(): 1099 objs.append(AuthorizedKeyReader.read_one(reader)) 1100 1101 # Discard the end tag: 1102 reader.read() 1103 1104 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1036 @staticmethod 1037 def read_one(reader): 1038 # Do nothing if there aren't more tags: 1039 if not reader.forward(): 1040 return None 1041 1042 # Create the object: 1043 obj = types.AuthorizedKey() 1044 1045 # Process the attributes: 1046 obj.href = reader.get_attribute('href') 1047 value = reader.get_attribute('id') 1048 if value is not None: 1049 obj.id = value 1050 1051 # Discard the start tag: 1052 empty = reader.empty_element() 1053 reader.read() 1054 if empty: 1055 return obj 1056 1057 # Process the inner elements: 1058 links = [] 1059 while reader.forward(): 1060 tag = reader.node_name() 1061 if tag == 'comment': 1062 obj.comment = Reader.read_string(reader) 1063 elif tag == 'description': 1064 obj.description = Reader.read_string(reader) 1065 elif tag == 'key': 1066 obj.key = Reader.read_string(reader) 1067 elif tag == 'name': 1068 obj.name = Reader.read_string(reader) 1069 elif tag == 'user': 1070 obj.user = UserReader.read_one(reader) 1071 else: 1072 reader.next_element() 1073 for link in links: 1074 AuthorizedKeyReader._process_link(link, obj) 1075 1076 # Discard the end tag: 1077 reader.read() 1078 1079 return obj
1081 @staticmethod 1082 def read_many(reader): 1083 # Do nothing if there aren't more tags: 1084 objs = List() 1085 if not reader.forward(): 1086 return objs 1087 1088 # Process the attributes: 1089 objs.href = reader.get_attribute('href') 1090 1091 # Discard the start tag: 1092 empty = reader.empty_element() 1093 reader.read() 1094 if empty: 1095 return objs 1096 1097 # Process the inner elements: 1098 while reader.forward(): 1099 objs.append(AuthorizedKeyReader.read_one(reader)) 1100 1101 # Discard the end tag: 1102 reader.read() 1103 1104 return objs
1107class BackupReader(Reader): 1108 1109 def __init__(self): 1110 super(BackupReader, self).__init__() 1111 1112 @staticmethod 1113 def read_one(reader): 1114 # Do nothing if there aren't more tags: 1115 if not reader.forward(): 1116 return None 1117 1118 # Create the object: 1119 obj = types.Backup() 1120 1121 # Process the attributes: 1122 obj.href = reader.get_attribute('href') 1123 value = reader.get_attribute('id') 1124 if value is not None: 1125 obj.id = value 1126 1127 # Discard the start tag: 1128 empty = reader.empty_element() 1129 reader.read() 1130 if empty: 1131 return obj 1132 1133 # Process the inner elements: 1134 links = [] 1135 while reader.forward(): 1136 tag = reader.node_name() 1137 if tag == 'comment': 1138 obj.comment = Reader.read_string(reader) 1139 elif tag == 'creation_date': 1140 obj.creation_date = Reader.read_date(reader) 1141 elif tag == 'description': 1142 obj.description = Reader.read_string(reader) 1143 elif tag == 'disks': 1144 obj.disks = DiskReader.read_many(reader) 1145 elif tag == 'from_checkpoint_id': 1146 obj.from_checkpoint_id = Reader.read_string(reader) 1147 elif tag == 'host': 1148 obj.host = HostReader.read_one(reader) 1149 elif tag == 'modification_date': 1150 obj.modification_date = Reader.read_date(reader) 1151 elif tag == 'name': 1152 obj.name = Reader.read_string(reader) 1153 elif tag == 'phase': 1154 obj.phase = Reader.read_enum(types.BackupPhase, reader) 1155 elif tag == 'snapshot': 1156 obj.snapshot = SnapshotReader.read_one(reader) 1157 elif tag == 'to_checkpoint_id': 1158 obj.to_checkpoint_id = Reader.read_string(reader) 1159 elif tag == 'vm': 1160 obj.vm = VmReader.read_one(reader) 1161 elif tag == 'link': 1162 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1163 reader.next_element() 1164 else: 1165 reader.next_element() 1166 for link in links: 1167 BackupReader._process_link(link, obj) 1168 1169 # Discard the end tag: 1170 reader.read() 1171 1172 return obj 1173 1174 @staticmethod 1175 def read_many(reader): 1176 # Do nothing if there aren't more tags: 1177 objs = List() 1178 if not reader.forward(): 1179 return objs 1180 1181 # Process the attributes: 1182 objs.href = reader.get_attribute('href') 1183 1184 # Discard the start tag: 1185 empty = reader.empty_element() 1186 reader.read() 1187 if empty: 1188 return objs 1189 1190 # Process the inner elements: 1191 while reader.forward(): 1192 objs.append(BackupReader.read_one(reader)) 1193 1194 # Discard the end tag: 1195 reader.read() 1196 1197 return objs 1198 1199 @staticmethod 1200 def _process_link(link, obj): 1201 # Process the attributes: 1202 rel = link[0] 1203 href = link[1] 1204 if href and rel: 1205 if rel == "disks": 1206 if obj.disks is not None: 1207 obj.disks.href = href 1208 else: 1209 obj.disks = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1112 @staticmethod 1113 def read_one(reader): 1114 # Do nothing if there aren't more tags: 1115 if not reader.forward(): 1116 return None 1117 1118 # Create the object: 1119 obj = types.Backup() 1120 1121 # Process the attributes: 1122 obj.href = reader.get_attribute('href') 1123 value = reader.get_attribute('id') 1124 if value is not None: 1125 obj.id = value 1126 1127 # Discard the start tag: 1128 empty = reader.empty_element() 1129 reader.read() 1130 if empty: 1131 return obj 1132 1133 # Process the inner elements: 1134 links = [] 1135 while reader.forward(): 1136 tag = reader.node_name() 1137 if tag == 'comment': 1138 obj.comment = Reader.read_string(reader) 1139 elif tag == 'creation_date': 1140 obj.creation_date = Reader.read_date(reader) 1141 elif tag == 'description': 1142 obj.description = Reader.read_string(reader) 1143 elif tag == 'disks': 1144 obj.disks = DiskReader.read_many(reader) 1145 elif tag == 'from_checkpoint_id': 1146 obj.from_checkpoint_id = Reader.read_string(reader) 1147 elif tag == 'host': 1148 obj.host = HostReader.read_one(reader) 1149 elif tag == 'modification_date': 1150 obj.modification_date = Reader.read_date(reader) 1151 elif tag == 'name': 1152 obj.name = Reader.read_string(reader) 1153 elif tag == 'phase': 1154 obj.phase = Reader.read_enum(types.BackupPhase, reader) 1155 elif tag == 'snapshot': 1156 obj.snapshot = SnapshotReader.read_one(reader) 1157 elif tag == 'to_checkpoint_id': 1158 obj.to_checkpoint_id = Reader.read_string(reader) 1159 elif tag == 'vm': 1160 obj.vm = VmReader.read_one(reader) 1161 elif tag == 'link': 1162 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1163 reader.next_element() 1164 else: 1165 reader.next_element() 1166 for link in links: 1167 BackupReader._process_link(link, obj) 1168 1169 # Discard the end tag: 1170 reader.read() 1171 1172 return obj
1174 @staticmethod 1175 def read_many(reader): 1176 # Do nothing if there aren't more tags: 1177 objs = List() 1178 if not reader.forward(): 1179 return objs 1180 1181 # Process the attributes: 1182 objs.href = reader.get_attribute('href') 1183 1184 # Discard the start tag: 1185 empty = reader.empty_element() 1186 reader.read() 1187 if empty: 1188 return objs 1189 1190 # Process the inner elements: 1191 while reader.forward(): 1192 objs.append(BackupReader.read_one(reader)) 1193 1194 # Discard the end tag: 1195 reader.read() 1196 1197 return objs
1212class BalanceReader(Reader): 1213 1214 def __init__(self): 1215 super(BalanceReader, self).__init__() 1216 1217 @staticmethod 1218 def read_one(reader): 1219 # Do nothing if there aren't more tags: 1220 if not reader.forward(): 1221 return None 1222 1223 # Create the object: 1224 obj = types.Balance() 1225 1226 # Process the attributes: 1227 obj.href = reader.get_attribute('href') 1228 value = reader.get_attribute('id') 1229 if value is not None: 1230 obj.id = value 1231 1232 # Discard the start tag: 1233 empty = reader.empty_element() 1234 reader.read() 1235 if empty: 1236 return obj 1237 1238 # Process the inner elements: 1239 links = [] 1240 while reader.forward(): 1241 tag = reader.node_name() 1242 if tag == 'comment': 1243 obj.comment = Reader.read_string(reader) 1244 elif tag == 'description': 1245 obj.description = Reader.read_string(reader) 1246 elif tag == 'name': 1247 obj.name = Reader.read_string(reader) 1248 elif tag == 'scheduling_policy': 1249 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 1250 elif tag == 'scheduling_policy_unit': 1251 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 1252 else: 1253 reader.next_element() 1254 for link in links: 1255 BalanceReader._process_link(link, obj) 1256 1257 # Discard the end tag: 1258 reader.read() 1259 1260 return obj 1261 1262 @staticmethod 1263 def read_many(reader): 1264 # Do nothing if there aren't more tags: 1265 objs = List() 1266 if not reader.forward(): 1267 return objs 1268 1269 # Process the attributes: 1270 objs.href = reader.get_attribute('href') 1271 1272 # Discard the start tag: 1273 empty = reader.empty_element() 1274 reader.read() 1275 if empty: 1276 return objs 1277 1278 # Process the inner elements: 1279 while reader.forward(): 1280 objs.append(BalanceReader.read_one(reader)) 1281 1282 # Discard the end tag: 1283 reader.read() 1284 1285 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1217 @staticmethod 1218 def read_one(reader): 1219 # Do nothing if there aren't more tags: 1220 if not reader.forward(): 1221 return None 1222 1223 # Create the object: 1224 obj = types.Balance() 1225 1226 # Process the attributes: 1227 obj.href = reader.get_attribute('href') 1228 value = reader.get_attribute('id') 1229 if value is not None: 1230 obj.id = value 1231 1232 # Discard the start tag: 1233 empty = reader.empty_element() 1234 reader.read() 1235 if empty: 1236 return obj 1237 1238 # Process the inner elements: 1239 links = [] 1240 while reader.forward(): 1241 tag = reader.node_name() 1242 if tag == 'comment': 1243 obj.comment = Reader.read_string(reader) 1244 elif tag == 'description': 1245 obj.description = Reader.read_string(reader) 1246 elif tag == 'name': 1247 obj.name = Reader.read_string(reader) 1248 elif tag == 'scheduling_policy': 1249 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 1250 elif tag == 'scheduling_policy_unit': 1251 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 1252 else: 1253 reader.next_element() 1254 for link in links: 1255 BalanceReader._process_link(link, obj) 1256 1257 # Discard the end tag: 1258 reader.read() 1259 1260 return obj
1262 @staticmethod 1263 def read_many(reader): 1264 # Do nothing if there aren't more tags: 1265 objs = List() 1266 if not reader.forward(): 1267 return objs 1268 1269 # Process the attributes: 1270 objs.href = reader.get_attribute('href') 1271 1272 # Discard the start tag: 1273 empty = reader.empty_element() 1274 reader.read() 1275 if empty: 1276 return objs 1277 1278 # Process the inner elements: 1279 while reader.forward(): 1280 objs.append(BalanceReader.read_one(reader)) 1281 1282 # Discard the end tag: 1283 reader.read() 1284 1285 return objs
1288class BiosReader(Reader): 1289 1290 def __init__(self): 1291 super(BiosReader, self).__init__() 1292 1293 @staticmethod 1294 def read_one(reader): 1295 # Do nothing if there aren't more tags: 1296 if not reader.forward(): 1297 return None 1298 1299 # Create the object: 1300 obj = types.Bios() 1301 1302 # Process the attributes: 1303 obj.href = reader.get_attribute('href') 1304 1305 # Discard the start tag: 1306 empty = reader.empty_element() 1307 reader.read() 1308 if empty: 1309 return obj 1310 1311 # Process the inner elements: 1312 links = [] 1313 while reader.forward(): 1314 tag = reader.node_name() 1315 if tag == 'boot_menu': 1316 obj.boot_menu = BootMenuReader.read_one(reader) 1317 elif tag == 'type': 1318 obj.type = Reader.read_enum(types.BiosType, reader) 1319 else: 1320 reader.next_element() 1321 for link in links: 1322 BiosReader._process_link(link, obj) 1323 1324 # Discard the end tag: 1325 reader.read() 1326 1327 return obj 1328 1329 @staticmethod 1330 def read_many(reader): 1331 # Do nothing if there aren't more tags: 1332 objs = List() 1333 if not reader.forward(): 1334 return objs 1335 1336 # Process the attributes: 1337 objs.href = reader.get_attribute('href') 1338 1339 # Discard the start tag: 1340 empty = reader.empty_element() 1341 reader.read() 1342 if empty: 1343 return objs 1344 1345 # Process the inner elements: 1346 while reader.forward(): 1347 objs.append(BiosReader.read_one(reader)) 1348 1349 # Discard the end tag: 1350 reader.read() 1351 1352 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1293 @staticmethod 1294 def read_one(reader): 1295 # Do nothing if there aren't more tags: 1296 if not reader.forward(): 1297 return None 1298 1299 # Create the object: 1300 obj = types.Bios() 1301 1302 # Process the attributes: 1303 obj.href = reader.get_attribute('href') 1304 1305 # Discard the start tag: 1306 empty = reader.empty_element() 1307 reader.read() 1308 if empty: 1309 return obj 1310 1311 # Process the inner elements: 1312 links = [] 1313 while reader.forward(): 1314 tag = reader.node_name() 1315 if tag == 'boot_menu': 1316 obj.boot_menu = BootMenuReader.read_one(reader) 1317 elif tag == 'type': 1318 obj.type = Reader.read_enum(types.BiosType, reader) 1319 else: 1320 reader.next_element() 1321 for link in links: 1322 BiosReader._process_link(link, obj) 1323 1324 # Discard the end tag: 1325 reader.read() 1326 1327 return obj
1329 @staticmethod 1330 def read_many(reader): 1331 # Do nothing if there aren't more tags: 1332 objs = List() 1333 if not reader.forward(): 1334 return objs 1335 1336 # Process the attributes: 1337 objs.href = reader.get_attribute('href') 1338 1339 # Discard the start tag: 1340 empty = reader.empty_element() 1341 reader.read() 1342 if empty: 1343 return objs 1344 1345 # Process the inner elements: 1346 while reader.forward(): 1347 objs.append(BiosReader.read_one(reader)) 1348 1349 # Discard the end tag: 1350 reader.read() 1351 1352 return objs
1355class BlockStatisticReader(Reader): 1356 1357 def __init__(self): 1358 super(BlockStatisticReader, self).__init__() 1359 1360 @staticmethod 1361 def read_one(reader): 1362 # Do nothing if there aren't more tags: 1363 if not reader.forward(): 1364 return None 1365 1366 # Create the object: 1367 obj = types.BlockStatistic() 1368 1369 # Process the attributes: 1370 obj.href = reader.get_attribute('href') 1371 1372 # Discard the start tag: 1373 empty = reader.empty_element() 1374 reader.read() 1375 if empty: 1376 return obj 1377 1378 # Process the inner elements: 1379 links = [] 1380 while reader.forward(): 1381 tag = reader.node_name() 1382 if tag == 'statistics': 1383 obj.statistics = StatisticReader.read_many(reader) 1384 else: 1385 reader.next_element() 1386 for link in links: 1387 BlockStatisticReader._process_link(link, obj) 1388 1389 # Discard the end tag: 1390 reader.read() 1391 1392 return obj 1393 1394 @staticmethod 1395 def read_many(reader): 1396 # Do nothing if there aren't more tags: 1397 objs = List() 1398 if not reader.forward(): 1399 return objs 1400 1401 # Process the attributes: 1402 objs.href = reader.get_attribute('href') 1403 1404 # Discard the start tag: 1405 empty = reader.empty_element() 1406 reader.read() 1407 if empty: 1408 return objs 1409 1410 # Process the inner elements: 1411 while reader.forward(): 1412 objs.append(BlockStatisticReader.read_one(reader)) 1413 1414 # Discard the end tag: 1415 reader.read() 1416 1417 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1360 @staticmethod 1361 def read_one(reader): 1362 # Do nothing if there aren't more tags: 1363 if not reader.forward(): 1364 return None 1365 1366 # Create the object: 1367 obj = types.BlockStatistic() 1368 1369 # Process the attributes: 1370 obj.href = reader.get_attribute('href') 1371 1372 # Discard the start tag: 1373 empty = reader.empty_element() 1374 reader.read() 1375 if empty: 1376 return obj 1377 1378 # Process the inner elements: 1379 links = [] 1380 while reader.forward(): 1381 tag = reader.node_name() 1382 if tag == 'statistics': 1383 obj.statistics = StatisticReader.read_many(reader) 1384 else: 1385 reader.next_element() 1386 for link in links: 1387 BlockStatisticReader._process_link(link, obj) 1388 1389 # Discard the end tag: 1390 reader.read() 1391 1392 return obj
1394 @staticmethod 1395 def read_many(reader): 1396 # Do nothing if there aren't more tags: 1397 objs = List() 1398 if not reader.forward(): 1399 return objs 1400 1401 # Process the attributes: 1402 objs.href = reader.get_attribute('href') 1403 1404 # Discard the start tag: 1405 empty = reader.empty_element() 1406 reader.read() 1407 if empty: 1408 return objs 1409 1410 # Process the inner elements: 1411 while reader.forward(): 1412 objs.append(BlockStatisticReader.read_one(reader)) 1413 1414 # Discard the end tag: 1415 reader.read() 1416 1417 return objs
1420class BondingReader(Reader): 1421 1422 def __init__(self): 1423 super(BondingReader, self).__init__() 1424 1425 @staticmethod 1426 def read_one(reader): 1427 # Do nothing if there aren't more tags: 1428 if not reader.forward(): 1429 return None 1430 1431 # Create the object: 1432 obj = types.Bonding() 1433 1434 # Process the attributes: 1435 obj.href = reader.get_attribute('href') 1436 1437 # Discard the start tag: 1438 empty = reader.empty_element() 1439 reader.read() 1440 if empty: 1441 return obj 1442 1443 # Process the inner elements: 1444 links = [] 1445 while reader.forward(): 1446 tag = reader.node_name() 1447 if tag == 'active_slave': 1448 obj.active_slave = HostNicReader.read_one(reader) 1449 elif tag == 'ad_partner_mac': 1450 obj.ad_partner_mac = MacReader.read_one(reader) 1451 elif tag == 'options': 1452 obj.options = OptionReader.read_many(reader) 1453 elif tag == 'slaves': 1454 obj.slaves = HostNicReader.read_many(reader) 1455 else: 1456 reader.next_element() 1457 for link in links: 1458 BondingReader._process_link(link, obj) 1459 1460 # Discard the end tag: 1461 reader.read() 1462 1463 return obj 1464 1465 @staticmethod 1466 def read_many(reader): 1467 # Do nothing if there aren't more tags: 1468 objs = List() 1469 if not reader.forward(): 1470 return objs 1471 1472 # Process the attributes: 1473 objs.href = reader.get_attribute('href') 1474 1475 # Discard the start tag: 1476 empty = reader.empty_element() 1477 reader.read() 1478 if empty: 1479 return objs 1480 1481 # Process the inner elements: 1482 while reader.forward(): 1483 objs.append(BondingReader.read_one(reader)) 1484 1485 # Discard the end tag: 1486 reader.read() 1487 1488 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1425 @staticmethod 1426 def read_one(reader): 1427 # Do nothing if there aren't more tags: 1428 if not reader.forward(): 1429 return None 1430 1431 # Create the object: 1432 obj = types.Bonding() 1433 1434 # Process the attributes: 1435 obj.href = reader.get_attribute('href') 1436 1437 # Discard the start tag: 1438 empty = reader.empty_element() 1439 reader.read() 1440 if empty: 1441 return obj 1442 1443 # Process the inner elements: 1444 links = [] 1445 while reader.forward(): 1446 tag = reader.node_name() 1447 if tag == 'active_slave': 1448 obj.active_slave = HostNicReader.read_one(reader) 1449 elif tag == 'ad_partner_mac': 1450 obj.ad_partner_mac = MacReader.read_one(reader) 1451 elif tag == 'options': 1452 obj.options = OptionReader.read_many(reader) 1453 elif tag == 'slaves': 1454 obj.slaves = HostNicReader.read_many(reader) 1455 else: 1456 reader.next_element() 1457 for link in links: 1458 BondingReader._process_link(link, obj) 1459 1460 # Discard the end tag: 1461 reader.read() 1462 1463 return obj
1465 @staticmethod 1466 def read_many(reader): 1467 # Do nothing if there aren't more tags: 1468 objs = List() 1469 if not reader.forward(): 1470 return objs 1471 1472 # Process the attributes: 1473 objs.href = reader.get_attribute('href') 1474 1475 # Discard the start tag: 1476 empty = reader.empty_element() 1477 reader.read() 1478 if empty: 1479 return objs 1480 1481 # Process the inner elements: 1482 while reader.forward(): 1483 objs.append(BondingReader.read_one(reader)) 1484 1485 # Discard the end tag: 1486 reader.read() 1487 1488 return objs
1491class BookmarkReader(Reader): 1492 1493 def __init__(self): 1494 super(BookmarkReader, self).__init__() 1495 1496 @staticmethod 1497 def read_one(reader): 1498 # Do nothing if there aren't more tags: 1499 if not reader.forward(): 1500 return None 1501 1502 # Create the object: 1503 obj = types.Bookmark() 1504 1505 # Process the attributes: 1506 obj.href = reader.get_attribute('href') 1507 value = reader.get_attribute('id') 1508 if value is not None: 1509 obj.id = value 1510 1511 # Discard the start tag: 1512 empty = reader.empty_element() 1513 reader.read() 1514 if empty: 1515 return obj 1516 1517 # Process the inner elements: 1518 links = [] 1519 while reader.forward(): 1520 tag = reader.node_name() 1521 if tag == 'comment': 1522 obj.comment = Reader.read_string(reader) 1523 elif tag == 'description': 1524 obj.description = Reader.read_string(reader) 1525 elif tag == 'name': 1526 obj.name = Reader.read_string(reader) 1527 elif tag == 'value': 1528 obj.value = Reader.read_string(reader) 1529 else: 1530 reader.next_element() 1531 for link in links: 1532 BookmarkReader._process_link(link, obj) 1533 1534 # Discard the end tag: 1535 reader.read() 1536 1537 return obj 1538 1539 @staticmethod 1540 def read_many(reader): 1541 # Do nothing if there aren't more tags: 1542 objs = List() 1543 if not reader.forward(): 1544 return objs 1545 1546 # Process the attributes: 1547 objs.href = reader.get_attribute('href') 1548 1549 # Discard the start tag: 1550 empty = reader.empty_element() 1551 reader.read() 1552 if empty: 1553 return objs 1554 1555 # Process the inner elements: 1556 while reader.forward(): 1557 objs.append(BookmarkReader.read_one(reader)) 1558 1559 # Discard the end tag: 1560 reader.read() 1561 1562 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1496 @staticmethod 1497 def read_one(reader): 1498 # Do nothing if there aren't more tags: 1499 if not reader.forward(): 1500 return None 1501 1502 # Create the object: 1503 obj = types.Bookmark() 1504 1505 # Process the attributes: 1506 obj.href = reader.get_attribute('href') 1507 value = reader.get_attribute('id') 1508 if value is not None: 1509 obj.id = value 1510 1511 # Discard the start tag: 1512 empty = reader.empty_element() 1513 reader.read() 1514 if empty: 1515 return obj 1516 1517 # Process the inner elements: 1518 links = [] 1519 while reader.forward(): 1520 tag = reader.node_name() 1521 if tag == 'comment': 1522 obj.comment = Reader.read_string(reader) 1523 elif tag == 'description': 1524 obj.description = Reader.read_string(reader) 1525 elif tag == 'name': 1526 obj.name = Reader.read_string(reader) 1527 elif tag == 'value': 1528 obj.value = Reader.read_string(reader) 1529 else: 1530 reader.next_element() 1531 for link in links: 1532 BookmarkReader._process_link(link, obj) 1533 1534 # Discard the end tag: 1535 reader.read() 1536 1537 return obj
1539 @staticmethod 1540 def read_many(reader): 1541 # Do nothing if there aren't more tags: 1542 objs = List() 1543 if not reader.forward(): 1544 return objs 1545 1546 # Process the attributes: 1547 objs.href = reader.get_attribute('href') 1548 1549 # Discard the start tag: 1550 empty = reader.empty_element() 1551 reader.read() 1552 if empty: 1553 return objs 1554 1555 # Process the inner elements: 1556 while reader.forward(): 1557 objs.append(BookmarkReader.read_one(reader)) 1558 1559 # Discard the end tag: 1560 reader.read() 1561 1562 return objs
1565class BootReader(Reader): 1566 1567 def __init__(self): 1568 super(BootReader, self).__init__() 1569 1570 @staticmethod 1571 def read_one(reader): 1572 # Do nothing if there aren't more tags: 1573 if not reader.forward(): 1574 return None 1575 1576 # Create the object: 1577 obj = types.Boot() 1578 1579 # Process the attributes: 1580 obj.href = reader.get_attribute('href') 1581 1582 # Discard the start tag: 1583 empty = reader.empty_element() 1584 reader.read() 1585 if empty: 1586 return obj 1587 1588 # Process the inner elements: 1589 links = [] 1590 while reader.forward(): 1591 tag = reader.node_name() 1592 if tag == 'devices': 1593 obj.devices = Reader.read_enums(types.BootDevice, reader) 1594 else: 1595 reader.next_element() 1596 for link in links: 1597 BootReader._process_link(link, obj) 1598 1599 # Discard the end tag: 1600 reader.read() 1601 1602 return obj 1603 1604 @staticmethod 1605 def read_many(reader): 1606 # Do nothing if there aren't more tags: 1607 objs = List() 1608 if not reader.forward(): 1609 return objs 1610 1611 # Process the attributes: 1612 objs.href = reader.get_attribute('href') 1613 1614 # Discard the start tag: 1615 empty = reader.empty_element() 1616 reader.read() 1617 if empty: 1618 return objs 1619 1620 # Process the inner elements: 1621 while reader.forward(): 1622 objs.append(BootReader.read_one(reader)) 1623 1624 # Discard the end tag: 1625 reader.read() 1626 1627 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1570 @staticmethod 1571 def read_one(reader): 1572 # Do nothing if there aren't more tags: 1573 if not reader.forward(): 1574 return None 1575 1576 # Create the object: 1577 obj = types.Boot() 1578 1579 # Process the attributes: 1580 obj.href = reader.get_attribute('href') 1581 1582 # Discard the start tag: 1583 empty = reader.empty_element() 1584 reader.read() 1585 if empty: 1586 return obj 1587 1588 # Process the inner elements: 1589 links = [] 1590 while reader.forward(): 1591 tag = reader.node_name() 1592 if tag == 'devices': 1593 obj.devices = Reader.read_enums(types.BootDevice, reader) 1594 else: 1595 reader.next_element() 1596 for link in links: 1597 BootReader._process_link(link, obj) 1598 1599 # Discard the end tag: 1600 reader.read() 1601 1602 return obj
1604 @staticmethod 1605 def read_many(reader): 1606 # Do nothing if there aren't more tags: 1607 objs = List() 1608 if not reader.forward(): 1609 return objs 1610 1611 # Process the attributes: 1612 objs.href = reader.get_attribute('href') 1613 1614 # Discard the start tag: 1615 empty = reader.empty_element() 1616 reader.read() 1617 if empty: 1618 return objs 1619 1620 # Process the inner elements: 1621 while reader.forward(): 1622 objs.append(BootReader.read_one(reader)) 1623 1624 # Discard the end tag: 1625 reader.read() 1626 1627 return objs
1630class BootMenuReader(Reader): 1631 1632 def __init__(self): 1633 super(BootMenuReader, self).__init__() 1634 1635 @staticmethod 1636 def read_one(reader): 1637 # Do nothing if there aren't more tags: 1638 if not reader.forward(): 1639 return None 1640 1641 # Create the object: 1642 obj = types.BootMenu() 1643 1644 # Process the attributes: 1645 obj.href = reader.get_attribute('href') 1646 1647 # Discard the start tag: 1648 empty = reader.empty_element() 1649 reader.read() 1650 if empty: 1651 return obj 1652 1653 # Process the inner elements: 1654 links = [] 1655 while reader.forward(): 1656 tag = reader.node_name() 1657 if tag == 'enabled': 1658 obj.enabled = Reader.read_boolean(reader) 1659 else: 1660 reader.next_element() 1661 for link in links: 1662 BootMenuReader._process_link(link, obj) 1663 1664 # Discard the end tag: 1665 reader.read() 1666 1667 return obj 1668 1669 @staticmethod 1670 def read_many(reader): 1671 # Do nothing if there aren't more tags: 1672 objs = List() 1673 if not reader.forward(): 1674 return objs 1675 1676 # Process the attributes: 1677 objs.href = reader.get_attribute('href') 1678 1679 # Discard the start tag: 1680 empty = reader.empty_element() 1681 reader.read() 1682 if empty: 1683 return objs 1684 1685 # Process the inner elements: 1686 while reader.forward(): 1687 objs.append(BootMenuReader.read_one(reader)) 1688 1689 # Discard the end tag: 1690 reader.read() 1691 1692 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1635 @staticmethod 1636 def read_one(reader): 1637 # Do nothing if there aren't more tags: 1638 if not reader.forward(): 1639 return None 1640 1641 # Create the object: 1642 obj = types.BootMenu() 1643 1644 # Process the attributes: 1645 obj.href = reader.get_attribute('href') 1646 1647 # Discard the start tag: 1648 empty = reader.empty_element() 1649 reader.read() 1650 if empty: 1651 return obj 1652 1653 # Process the inner elements: 1654 links = [] 1655 while reader.forward(): 1656 tag = reader.node_name() 1657 if tag == 'enabled': 1658 obj.enabled = Reader.read_boolean(reader) 1659 else: 1660 reader.next_element() 1661 for link in links: 1662 BootMenuReader._process_link(link, obj) 1663 1664 # Discard the end tag: 1665 reader.read() 1666 1667 return obj
1669 @staticmethod 1670 def read_many(reader): 1671 # Do nothing if there aren't more tags: 1672 objs = List() 1673 if not reader.forward(): 1674 return objs 1675 1676 # Process the attributes: 1677 objs.href = reader.get_attribute('href') 1678 1679 # Discard the start tag: 1680 empty = reader.empty_element() 1681 reader.read() 1682 if empty: 1683 return objs 1684 1685 # Process the inner elements: 1686 while reader.forward(): 1687 objs.append(BootMenuReader.read_one(reader)) 1688 1689 # Discard the end tag: 1690 reader.read() 1691 1692 return objs
1695class BrickProfileDetailReader(Reader): 1696 1697 def __init__(self): 1698 super(BrickProfileDetailReader, self).__init__() 1699 1700 @staticmethod 1701 def read_one(reader): 1702 # Do nothing if there aren't more tags: 1703 if not reader.forward(): 1704 return None 1705 1706 # Create the object: 1707 obj = types.BrickProfileDetail() 1708 1709 # Process the attributes: 1710 obj.href = reader.get_attribute('href') 1711 1712 # Discard the start tag: 1713 empty = reader.empty_element() 1714 reader.read() 1715 if empty: 1716 return obj 1717 1718 # Process the inner elements: 1719 links = [] 1720 while reader.forward(): 1721 tag = reader.node_name() 1722 if tag == 'brick': 1723 obj.brick = GlusterBrickReader.read_one(reader) 1724 elif tag == 'profile_details': 1725 obj.profile_details = ProfileDetailReader.read_many(reader) 1726 else: 1727 reader.next_element() 1728 for link in links: 1729 BrickProfileDetailReader._process_link(link, obj) 1730 1731 # Discard the end tag: 1732 reader.read() 1733 1734 return obj 1735 1736 @staticmethod 1737 def read_many(reader): 1738 # Do nothing if there aren't more tags: 1739 objs = List() 1740 if not reader.forward(): 1741 return objs 1742 1743 # Process the attributes: 1744 objs.href = reader.get_attribute('href') 1745 1746 # Discard the start tag: 1747 empty = reader.empty_element() 1748 reader.read() 1749 if empty: 1750 return objs 1751 1752 # Process the inner elements: 1753 while reader.forward(): 1754 objs.append(BrickProfileDetailReader.read_one(reader)) 1755 1756 # Discard the end tag: 1757 reader.read() 1758 1759 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1700 @staticmethod 1701 def read_one(reader): 1702 # Do nothing if there aren't more tags: 1703 if not reader.forward(): 1704 return None 1705 1706 # Create the object: 1707 obj = types.BrickProfileDetail() 1708 1709 # Process the attributes: 1710 obj.href = reader.get_attribute('href') 1711 1712 # Discard the start tag: 1713 empty = reader.empty_element() 1714 reader.read() 1715 if empty: 1716 return obj 1717 1718 # Process the inner elements: 1719 links = [] 1720 while reader.forward(): 1721 tag = reader.node_name() 1722 if tag == 'brick': 1723 obj.brick = GlusterBrickReader.read_one(reader) 1724 elif tag == 'profile_details': 1725 obj.profile_details = ProfileDetailReader.read_many(reader) 1726 else: 1727 reader.next_element() 1728 for link in links: 1729 BrickProfileDetailReader._process_link(link, obj) 1730 1731 # Discard the end tag: 1732 reader.read() 1733 1734 return obj
1736 @staticmethod 1737 def read_many(reader): 1738 # Do nothing if there aren't more tags: 1739 objs = List() 1740 if not reader.forward(): 1741 return objs 1742 1743 # Process the attributes: 1744 objs.href = reader.get_attribute('href') 1745 1746 # Discard the start tag: 1747 empty = reader.empty_element() 1748 reader.read() 1749 if empty: 1750 return objs 1751 1752 # Process the inner elements: 1753 while reader.forward(): 1754 objs.append(BrickProfileDetailReader.read_one(reader)) 1755 1756 # Discard the end tag: 1757 reader.read() 1758 1759 return objs
1762class CdromReader(Reader): 1763 1764 def __init__(self): 1765 super(CdromReader, self).__init__() 1766 1767 @staticmethod 1768 def read_one(reader): 1769 # Do nothing if there aren't more tags: 1770 if not reader.forward(): 1771 return None 1772 1773 # Create the object: 1774 obj = types.Cdrom() 1775 1776 # Process the attributes: 1777 obj.href = reader.get_attribute('href') 1778 value = reader.get_attribute('id') 1779 if value is not None: 1780 obj.id = value 1781 1782 # Discard the start tag: 1783 empty = reader.empty_element() 1784 reader.read() 1785 if empty: 1786 return obj 1787 1788 # Process the inner elements: 1789 links = [] 1790 while reader.forward(): 1791 tag = reader.node_name() 1792 if tag == 'comment': 1793 obj.comment = Reader.read_string(reader) 1794 elif tag == 'description': 1795 obj.description = Reader.read_string(reader) 1796 elif tag == 'file': 1797 obj.file = FileReader.read_one(reader) 1798 elif tag == 'instance_type': 1799 obj.instance_type = InstanceTypeReader.read_one(reader) 1800 elif tag == 'name': 1801 obj.name = Reader.read_string(reader) 1802 elif tag == 'template': 1803 obj.template = TemplateReader.read_one(reader) 1804 elif tag == 'vm': 1805 obj.vm = VmReader.read_one(reader) 1806 elif tag == 'vms': 1807 obj.vms = VmReader.read_many(reader) 1808 elif tag == 'link': 1809 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1810 reader.next_element() 1811 else: 1812 reader.next_element() 1813 for link in links: 1814 CdromReader._process_link(link, obj) 1815 1816 # Discard the end tag: 1817 reader.read() 1818 1819 return obj 1820 1821 @staticmethod 1822 def read_many(reader): 1823 # Do nothing if there aren't more tags: 1824 objs = List() 1825 if not reader.forward(): 1826 return objs 1827 1828 # Process the attributes: 1829 objs.href = reader.get_attribute('href') 1830 1831 # Discard the start tag: 1832 empty = reader.empty_element() 1833 reader.read() 1834 if empty: 1835 return objs 1836 1837 # Process the inner elements: 1838 while reader.forward(): 1839 objs.append(CdromReader.read_one(reader)) 1840 1841 # Discard the end tag: 1842 reader.read() 1843 1844 return objs 1845 1846 @staticmethod 1847 def _process_link(link, obj): 1848 # Process the attributes: 1849 rel = link[0] 1850 href = link[1] 1851 if href and rel: 1852 if rel == "vms": 1853 if obj.vms is not None: 1854 obj.vms.href = href 1855 else: 1856 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1767 @staticmethod 1768 def read_one(reader): 1769 # Do nothing if there aren't more tags: 1770 if not reader.forward(): 1771 return None 1772 1773 # Create the object: 1774 obj = types.Cdrom() 1775 1776 # Process the attributes: 1777 obj.href = reader.get_attribute('href') 1778 value = reader.get_attribute('id') 1779 if value is not None: 1780 obj.id = value 1781 1782 # Discard the start tag: 1783 empty = reader.empty_element() 1784 reader.read() 1785 if empty: 1786 return obj 1787 1788 # Process the inner elements: 1789 links = [] 1790 while reader.forward(): 1791 tag = reader.node_name() 1792 if tag == 'comment': 1793 obj.comment = Reader.read_string(reader) 1794 elif tag == 'description': 1795 obj.description = Reader.read_string(reader) 1796 elif tag == 'file': 1797 obj.file = FileReader.read_one(reader) 1798 elif tag == 'instance_type': 1799 obj.instance_type = InstanceTypeReader.read_one(reader) 1800 elif tag == 'name': 1801 obj.name = Reader.read_string(reader) 1802 elif tag == 'template': 1803 obj.template = TemplateReader.read_one(reader) 1804 elif tag == 'vm': 1805 obj.vm = VmReader.read_one(reader) 1806 elif tag == 'vms': 1807 obj.vms = VmReader.read_many(reader) 1808 elif tag == 'link': 1809 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1810 reader.next_element() 1811 else: 1812 reader.next_element() 1813 for link in links: 1814 CdromReader._process_link(link, obj) 1815 1816 # Discard the end tag: 1817 reader.read() 1818 1819 return obj
1821 @staticmethod 1822 def read_many(reader): 1823 # Do nothing if there aren't more tags: 1824 objs = List() 1825 if not reader.forward(): 1826 return objs 1827 1828 # Process the attributes: 1829 objs.href = reader.get_attribute('href') 1830 1831 # Discard the start tag: 1832 empty = reader.empty_element() 1833 reader.read() 1834 if empty: 1835 return objs 1836 1837 # Process the inner elements: 1838 while reader.forward(): 1839 objs.append(CdromReader.read_one(reader)) 1840 1841 # Discard the end tag: 1842 reader.read() 1843 1844 return objs
1859class CertificateReader(Reader): 1860 1861 def __init__(self): 1862 super(CertificateReader, self).__init__() 1863 1864 @staticmethod 1865 def read_one(reader): 1866 # Do nothing if there aren't more tags: 1867 if not reader.forward(): 1868 return None 1869 1870 # Create the object: 1871 obj = types.Certificate() 1872 1873 # Process the attributes: 1874 obj.href = reader.get_attribute('href') 1875 value = reader.get_attribute('id') 1876 if value is not None: 1877 obj.id = value 1878 1879 # Discard the start tag: 1880 empty = reader.empty_element() 1881 reader.read() 1882 if empty: 1883 return obj 1884 1885 # Process the inner elements: 1886 links = [] 1887 while reader.forward(): 1888 tag = reader.node_name() 1889 if tag == 'comment': 1890 obj.comment = Reader.read_string(reader) 1891 elif tag == 'content': 1892 obj.content = Reader.read_string(reader) 1893 elif tag == 'description': 1894 obj.description = Reader.read_string(reader) 1895 elif tag == 'name': 1896 obj.name = Reader.read_string(reader) 1897 elif tag == 'organization': 1898 obj.organization = Reader.read_string(reader) 1899 elif tag == 'subject': 1900 obj.subject = Reader.read_string(reader) 1901 else: 1902 reader.next_element() 1903 for link in links: 1904 CertificateReader._process_link(link, obj) 1905 1906 # Discard the end tag: 1907 reader.read() 1908 1909 return obj 1910 1911 @staticmethod 1912 def read_many(reader): 1913 # Do nothing if there aren't more tags: 1914 objs = List() 1915 if not reader.forward(): 1916 return objs 1917 1918 # Process the attributes: 1919 objs.href = reader.get_attribute('href') 1920 1921 # Discard the start tag: 1922 empty = reader.empty_element() 1923 reader.read() 1924 if empty: 1925 return objs 1926 1927 # Process the inner elements: 1928 while reader.forward(): 1929 objs.append(CertificateReader.read_one(reader)) 1930 1931 # Discard the end tag: 1932 reader.read() 1933 1934 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1864 @staticmethod 1865 def read_one(reader): 1866 # Do nothing if there aren't more tags: 1867 if not reader.forward(): 1868 return None 1869 1870 # Create the object: 1871 obj = types.Certificate() 1872 1873 # Process the attributes: 1874 obj.href = reader.get_attribute('href') 1875 value = reader.get_attribute('id') 1876 if value is not None: 1877 obj.id = value 1878 1879 # Discard the start tag: 1880 empty = reader.empty_element() 1881 reader.read() 1882 if empty: 1883 return obj 1884 1885 # Process the inner elements: 1886 links = [] 1887 while reader.forward(): 1888 tag = reader.node_name() 1889 if tag == 'comment': 1890 obj.comment = Reader.read_string(reader) 1891 elif tag == 'content': 1892 obj.content = Reader.read_string(reader) 1893 elif tag == 'description': 1894 obj.description = Reader.read_string(reader) 1895 elif tag == 'name': 1896 obj.name = Reader.read_string(reader) 1897 elif tag == 'organization': 1898 obj.organization = Reader.read_string(reader) 1899 elif tag == 'subject': 1900 obj.subject = Reader.read_string(reader) 1901 else: 1902 reader.next_element() 1903 for link in links: 1904 CertificateReader._process_link(link, obj) 1905 1906 # Discard the end tag: 1907 reader.read() 1908 1909 return obj
1911 @staticmethod 1912 def read_many(reader): 1913 # Do nothing if there aren't more tags: 1914 objs = List() 1915 if not reader.forward(): 1916 return objs 1917 1918 # Process the attributes: 1919 objs.href = reader.get_attribute('href') 1920 1921 # Discard the start tag: 1922 empty = reader.empty_element() 1923 reader.read() 1924 if empty: 1925 return objs 1926 1927 # Process the inner elements: 1928 while reader.forward(): 1929 objs.append(CertificateReader.read_one(reader)) 1930 1931 # Discard the end tag: 1932 reader.read() 1933 1934 return objs
1937class CheckpointReader(Reader): 1938 1939 def __init__(self): 1940 super(CheckpointReader, self).__init__() 1941 1942 @staticmethod 1943 def read_one(reader): 1944 # Do nothing if there aren't more tags: 1945 if not reader.forward(): 1946 return None 1947 1948 # Create the object: 1949 obj = types.Checkpoint() 1950 1951 # Process the attributes: 1952 obj.href = reader.get_attribute('href') 1953 value = reader.get_attribute('id') 1954 if value is not None: 1955 obj.id = value 1956 1957 # Discard the start tag: 1958 empty = reader.empty_element() 1959 reader.read() 1960 if empty: 1961 return obj 1962 1963 # Process the inner elements: 1964 links = [] 1965 while reader.forward(): 1966 tag = reader.node_name() 1967 if tag == 'comment': 1968 obj.comment = Reader.read_string(reader) 1969 elif tag == 'creation_date': 1970 obj.creation_date = Reader.read_date(reader) 1971 elif tag == 'description': 1972 obj.description = Reader.read_string(reader) 1973 elif tag == 'disks': 1974 obj.disks = DiskReader.read_many(reader) 1975 elif tag == 'name': 1976 obj.name = Reader.read_string(reader) 1977 elif tag == 'parent_id': 1978 obj.parent_id = Reader.read_string(reader) 1979 elif tag == 'state': 1980 obj.state = Reader.read_enum(types.CheckpointState, reader) 1981 elif tag == 'vm': 1982 obj.vm = VmReader.read_one(reader) 1983 elif tag == 'link': 1984 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1985 reader.next_element() 1986 else: 1987 reader.next_element() 1988 for link in links: 1989 CheckpointReader._process_link(link, obj) 1990 1991 # Discard the end tag: 1992 reader.read() 1993 1994 return obj 1995 1996 @staticmethod 1997 def read_many(reader): 1998 # Do nothing if there aren't more tags: 1999 objs = List() 2000 if not reader.forward(): 2001 return objs 2002 2003 # Process the attributes: 2004 objs.href = reader.get_attribute('href') 2005 2006 # Discard the start tag: 2007 empty = reader.empty_element() 2008 reader.read() 2009 if empty: 2010 return objs 2011 2012 # Process the inner elements: 2013 while reader.forward(): 2014 objs.append(CheckpointReader.read_one(reader)) 2015 2016 # Discard the end tag: 2017 reader.read() 2018 2019 return objs 2020 2021 @staticmethod 2022 def _process_link(link, obj): 2023 # Process the attributes: 2024 rel = link[0] 2025 href = link[1] 2026 if href and rel: 2027 if rel == "disks": 2028 if obj.disks is not None: 2029 obj.disks.href = href 2030 else: 2031 obj.disks = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
1942 @staticmethod 1943 def read_one(reader): 1944 # Do nothing if there aren't more tags: 1945 if not reader.forward(): 1946 return None 1947 1948 # Create the object: 1949 obj = types.Checkpoint() 1950 1951 # Process the attributes: 1952 obj.href = reader.get_attribute('href') 1953 value = reader.get_attribute('id') 1954 if value is not None: 1955 obj.id = value 1956 1957 # Discard the start tag: 1958 empty = reader.empty_element() 1959 reader.read() 1960 if empty: 1961 return obj 1962 1963 # Process the inner elements: 1964 links = [] 1965 while reader.forward(): 1966 tag = reader.node_name() 1967 if tag == 'comment': 1968 obj.comment = Reader.read_string(reader) 1969 elif tag == 'creation_date': 1970 obj.creation_date = Reader.read_date(reader) 1971 elif tag == 'description': 1972 obj.description = Reader.read_string(reader) 1973 elif tag == 'disks': 1974 obj.disks = DiskReader.read_many(reader) 1975 elif tag == 'name': 1976 obj.name = Reader.read_string(reader) 1977 elif tag == 'parent_id': 1978 obj.parent_id = Reader.read_string(reader) 1979 elif tag == 'state': 1980 obj.state = Reader.read_enum(types.CheckpointState, reader) 1981 elif tag == 'vm': 1982 obj.vm = VmReader.read_one(reader) 1983 elif tag == 'link': 1984 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 1985 reader.next_element() 1986 else: 1987 reader.next_element() 1988 for link in links: 1989 CheckpointReader._process_link(link, obj) 1990 1991 # Discard the end tag: 1992 reader.read() 1993 1994 return obj
1996 @staticmethod 1997 def read_many(reader): 1998 # Do nothing if there aren't more tags: 1999 objs = List() 2000 if not reader.forward(): 2001 return objs 2002 2003 # Process the attributes: 2004 objs.href = reader.get_attribute('href') 2005 2006 # Discard the start tag: 2007 empty = reader.empty_element() 2008 reader.read() 2009 if empty: 2010 return objs 2011 2012 # Process the inner elements: 2013 while reader.forward(): 2014 objs.append(CheckpointReader.read_one(reader)) 2015 2016 # Discard the end tag: 2017 reader.read() 2018 2019 return objs
2034class CloudInitReader(Reader): 2035 2036 def __init__(self): 2037 super(CloudInitReader, self).__init__() 2038 2039 @staticmethod 2040 def read_one(reader): 2041 # Do nothing if there aren't more tags: 2042 if not reader.forward(): 2043 return None 2044 2045 # Create the object: 2046 obj = types.CloudInit() 2047 2048 # Process the attributes: 2049 obj.href = reader.get_attribute('href') 2050 2051 # Discard the start tag: 2052 empty = reader.empty_element() 2053 reader.read() 2054 if empty: 2055 return obj 2056 2057 # Process the inner elements: 2058 links = [] 2059 while reader.forward(): 2060 tag = reader.node_name() 2061 if tag == 'authorized_keys': 2062 obj.authorized_keys = AuthorizedKeyReader.read_many(reader) 2063 elif tag == 'files': 2064 obj.files = FileReader.read_many(reader) 2065 elif tag == 'host': 2066 obj.host = HostReader.read_one(reader) 2067 elif tag == 'network_configuration': 2068 obj.network_configuration = NetworkConfigurationReader.read_one(reader) 2069 elif tag == 'regenerate_ssh_keys': 2070 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 2071 elif tag == 'timezone': 2072 obj.timezone = Reader.read_string(reader) 2073 elif tag == 'users': 2074 obj.users = UserReader.read_many(reader) 2075 else: 2076 reader.next_element() 2077 for link in links: 2078 CloudInitReader._process_link(link, obj) 2079 2080 # Discard the end tag: 2081 reader.read() 2082 2083 return obj 2084 2085 @staticmethod 2086 def read_many(reader): 2087 # Do nothing if there aren't more tags: 2088 objs = List() 2089 if not reader.forward(): 2090 return objs 2091 2092 # Process the attributes: 2093 objs.href = reader.get_attribute('href') 2094 2095 # Discard the start tag: 2096 empty = reader.empty_element() 2097 reader.read() 2098 if empty: 2099 return objs 2100 2101 # Process the inner elements: 2102 while reader.forward(): 2103 objs.append(CloudInitReader.read_one(reader)) 2104 2105 # Discard the end tag: 2106 reader.read() 2107 2108 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2039 @staticmethod 2040 def read_one(reader): 2041 # Do nothing if there aren't more tags: 2042 if not reader.forward(): 2043 return None 2044 2045 # Create the object: 2046 obj = types.CloudInit() 2047 2048 # Process the attributes: 2049 obj.href = reader.get_attribute('href') 2050 2051 # Discard the start tag: 2052 empty = reader.empty_element() 2053 reader.read() 2054 if empty: 2055 return obj 2056 2057 # Process the inner elements: 2058 links = [] 2059 while reader.forward(): 2060 tag = reader.node_name() 2061 if tag == 'authorized_keys': 2062 obj.authorized_keys = AuthorizedKeyReader.read_many(reader) 2063 elif tag == 'files': 2064 obj.files = FileReader.read_many(reader) 2065 elif tag == 'host': 2066 obj.host = HostReader.read_one(reader) 2067 elif tag == 'network_configuration': 2068 obj.network_configuration = NetworkConfigurationReader.read_one(reader) 2069 elif tag == 'regenerate_ssh_keys': 2070 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 2071 elif tag == 'timezone': 2072 obj.timezone = Reader.read_string(reader) 2073 elif tag == 'users': 2074 obj.users = UserReader.read_many(reader) 2075 else: 2076 reader.next_element() 2077 for link in links: 2078 CloudInitReader._process_link(link, obj) 2079 2080 # Discard the end tag: 2081 reader.read() 2082 2083 return obj
2085 @staticmethod 2086 def read_many(reader): 2087 # Do nothing if there aren't more tags: 2088 objs = List() 2089 if not reader.forward(): 2090 return objs 2091 2092 # Process the attributes: 2093 objs.href = reader.get_attribute('href') 2094 2095 # Discard the start tag: 2096 empty = reader.empty_element() 2097 reader.read() 2098 if empty: 2099 return objs 2100 2101 # Process the inner elements: 2102 while reader.forward(): 2103 objs.append(CloudInitReader.read_one(reader)) 2104 2105 # Discard the end tag: 2106 reader.read() 2107 2108 return objs
2111class ClusterReader(Reader): 2112 2113 def __init__(self): 2114 super(ClusterReader, self).__init__() 2115 2116 @staticmethod 2117 def read_one(reader): 2118 # Do nothing if there aren't more tags: 2119 if not reader.forward(): 2120 return None 2121 2122 # Create the object: 2123 obj = types.Cluster() 2124 2125 # Process the attributes: 2126 obj.href = reader.get_attribute('href') 2127 value = reader.get_attribute('id') 2128 if value is not None: 2129 obj.id = value 2130 2131 # Discard the start tag: 2132 empty = reader.empty_element() 2133 reader.read() 2134 if empty: 2135 return obj 2136 2137 # Process the inner elements: 2138 links = [] 2139 while reader.forward(): 2140 tag = reader.node_name() 2141 if tag == 'affinity_groups': 2142 obj.affinity_groups = AffinityGroupReader.read_many(reader) 2143 elif tag == 'ballooning_enabled': 2144 obj.ballooning_enabled = Reader.read_boolean(reader) 2145 elif tag == 'bios_type': 2146 obj.bios_type = Reader.read_enum(types.BiosType, reader) 2147 elif tag == 'comment': 2148 obj.comment = Reader.read_string(reader) 2149 elif tag == 'cpu': 2150 obj.cpu = CpuReader.read_one(reader) 2151 elif tag == 'cpu_profiles': 2152 obj.cpu_profiles = CpuProfileReader.read_many(reader) 2153 elif tag == 'custom_scheduling_policy_properties': 2154 obj.custom_scheduling_policy_properties = PropertyReader.read_many(reader) 2155 elif tag == 'data_center': 2156 obj.data_center = DataCenterReader.read_one(reader) 2157 elif tag == 'description': 2158 obj.description = Reader.read_string(reader) 2159 elif tag == 'display': 2160 obj.display = DisplayReader.read_one(reader) 2161 elif tag == 'enabled_features': 2162 obj.enabled_features = ClusterFeatureReader.read_many(reader) 2163 elif tag == 'error_handling': 2164 obj.error_handling = ErrorHandlingReader.read_one(reader) 2165 elif tag == 'external_network_providers': 2166 obj.external_network_providers = ExternalProviderReader.read_many(reader) 2167 elif tag == 'fencing_policy': 2168 obj.fencing_policy = FencingPolicyReader.read_one(reader) 2169 elif tag == 'fips_mode': 2170 obj.fips_mode = Reader.read_enum(types.FipsMode, reader) 2171 elif tag == 'firewall_type': 2172 obj.firewall_type = Reader.read_enum(types.FirewallType, reader) 2173 elif tag == 'gluster_hooks': 2174 obj.gluster_hooks = GlusterHookReader.read_many(reader) 2175 elif tag == 'gluster_service': 2176 obj.gluster_service = Reader.read_boolean(reader) 2177 elif tag == 'gluster_tuned_profile': 2178 obj.gluster_tuned_profile = Reader.read_string(reader) 2179 elif tag == 'gluster_volumes': 2180 obj.gluster_volumes = GlusterVolumeReader.read_many(reader) 2181 elif tag == 'ha_reservation': 2182 obj.ha_reservation = Reader.read_boolean(reader) 2183 elif tag == 'ksm': 2184 obj.ksm = KsmReader.read_one(reader) 2185 elif tag == 'log_max_memory_used_threshold': 2186 obj.log_max_memory_used_threshold = Reader.read_integer(reader) 2187 elif tag == 'log_max_memory_used_threshold_type': 2188 obj.log_max_memory_used_threshold_type = Reader.read_enum(types.LogMaxMemoryUsedThresholdType, reader) 2189 elif tag == 'mac_pool': 2190 obj.mac_pool = MacPoolReader.read_one(reader) 2191 elif tag == 'maintenance_reason_required': 2192 obj.maintenance_reason_required = Reader.read_boolean(reader) 2193 elif tag == 'management_network': 2194 obj.management_network = NetworkReader.read_one(reader) 2195 elif tag == 'memory_policy': 2196 obj.memory_policy = MemoryPolicyReader.read_one(reader) 2197 elif tag == 'migration': 2198 obj.migration = MigrationOptionsReader.read_one(reader) 2199 elif tag == 'name': 2200 obj.name = Reader.read_string(reader) 2201 elif tag == 'network_filters': 2202 obj.network_filters = NetworkFilterReader.read_many(reader) 2203 elif tag == 'networks': 2204 obj.networks = NetworkReader.read_many(reader) 2205 elif tag == 'optional_reason': 2206 obj.optional_reason = Reader.read_boolean(reader) 2207 elif tag == 'permissions': 2208 obj.permissions = PermissionReader.read_many(reader) 2209 elif tag == 'required_rng_sources': 2210 obj.required_rng_sources = Reader.read_enums(types.RngSource, reader) 2211 elif tag == 'scheduling_policy': 2212 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 2213 elif tag == 'serial_number': 2214 obj.serial_number = SerialNumberReader.read_one(reader) 2215 elif tag == 'supported_versions': 2216 obj.supported_versions = VersionReader.read_many(reader) 2217 elif tag == 'switch_type': 2218 obj.switch_type = Reader.read_enum(types.SwitchType, reader) 2219 elif tag == 'threads_as_cores': 2220 obj.threads_as_cores = Reader.read_boolean(reader) 2221 elif tag == 'trusted_service': 2222 obj.trusted_service = Reader.read_boolean(reader) 2223 elif tag == 'tunnel_migration': 2224 obj.tunnel_migration = Reader.read_boolean(reader) 2225 elif tag == 'upgrade_correlation_id': 2226 obj.upgrade_correlation_id = Reader.read_string(reader) 2227 elif tag == 'upgrade_in_progress': 2228 obj.upgrade_in_progress = Reader.read_boolean(reader) 2229 elif tag == 'upgrade_percent_complete': 2230 obj.upgrade_percent_complete = Reader.read_integer(reader) 2231 elif tag == 'version': 2232 obj.version = VersionReader.read_one(reader) 2233 elif tag == 'virt_service': 2234 obj.virt_service = Reader.read_boolean(reader) 2235 elif tag == 'vnc_encryption': 2236 obj.vnc_encryption = Reader.read_boolean(reader) 2237 elif tag == 'link': 2238 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2239 reader.next_element() 2240 else: 2241 reader.next_element() 2242 for link in links: 2243 ClusterReader._process_link(link, obj) 2244 2245 # Discard the end tag: 2246 reader.read() 2247 2248 return obj 2249 2250 @staticmethod 2251 def read_many(reader): 2252 # Do nothing if there aren't more tags: 2253 objs = List() 2254 if not reader.forward(): 2255 return objs 2256 2257 # Process the attributes: 2258 objs.href = reader.get_attribute('href') 2259 2260 # Discard the start tag: 2261 empty = reader.empty_element() 2262 reader.read() 2263 if empty: 2264 return objs 2265 2266 # Process the inner elements: 2267 while reader.forward(): 2268 objs.append(ClusterReader.read_one(reader)) 2269 2270 # Discard the end tag: 2271 reader.read() 2272 2273 return objs 2274 2275 @staticmethod 2276 def _process_link(link, obj): 2277 # Process the attributes: 2278 rel = link[0] 2279 href = link[1] 2280 if href and rel: 2281 if rel == "affinitygroups": 2282 if obj.affinity_groups is not None: 2283 obj.affinity_groups.href = href 2284 else: 2285 obj.affinity_groups = List(href) 2286 elif rel == "cpuprofiles": 2287 if obj.cpu_profiles is not None: 2288 obj.cpu_profiles.href = href 2289 else: 2290 obj.cpu_profiles = List(href) 2291 elif rel == "enabledfeatures": 2292 if obj.enabled_features is not None: 2293 obj.enabled_features.href = href 2294 else: 2295 obj.enabled_features = List(href) 2296 elif rel == "externalnetworkproviders": 2297 if obj.external_network_providers is not None: 2298 obj.external_network_providers.href = href 2299 else: 2300 obj.external_network_providers = List(href) 2301 elif rel == "glusterhooks": 2302 if obj.gluster_hooks is not None: 2303 obj.gluster_hooks.href = href 2304 else: 2305 obj.gluster_hooks = List(href) 2306 elif rel == "glustervolumes": 2307 if obj.gluster_volumes is not None: 2308 obj.gluster_volumes.href = href 2309 else: 2310 obj.gluster_volumes = List(href) 2311 elif rel == "networkfilters": 2312 if obj.network_filters is not None: 2313 obj.network_filters.href = href 2314 else: 2315 obj.network_filters = List(href) 2316 elif rel == "networks": 2317 if obj.networks is not None: 2318 obj.networks.href = href 2319 else: 2320 obj.networks = List(href) 2321 elif rel == "permissions": 2322 if obj.permissions is not None: 2323 obj.permissions.href = href 2324 else: 2325 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2116 @staticmethod 2117 def read_one(reader): 2118 # Do nothing if there aren't more tags: 2119 if not reader.forward(): 2120 return None 2121 2122 # Create the object: 2123 obj = types.Cluster() 2124 2125 # Process the attributes: 2126 obj.href = reader.get_attribute('href') 2127 value = reader.get_attribute('id') 2128 if value is not None: 2129 obj.id = value 2130 2131 # Discard the start tag: 2132 empty = reader.empty_element() 2133 reader.read() 2134 if empty: 2135 return obj 2136 2137 # Process the inner elements: 2138 links = [] 2139 while reader.forward(): 2140 tag = reader.node_name() 2141 if tag == 'affinity_groups': 2142 obj.affinity_groups = AffinityGroupReader.read_many(reader) 2143 elif tag == 'ballooning_enabled': 2144 obj.ballooning_enabled = Reader.read_boolean(reader) 2145 elif tag == 'bios_type': 2146 obj.bios_type = Reader.read_enum(types.BiosType, reader) 2147 elif tag == 'comment': 2148 obj.comment = Reader.read_string(reader) 2149 elif tag == 'cpu': 2150 obj.cpu = CpuReader.read_one(reader) 2151 elif tag == 'cpu_profiles': 2152 obj.cpu_profiles = CpuProfileReader.read_many(reader) 2153 elif tag == 'custom_scheduling_policy_properties': 2154 obj.custom_scheduling_policy_properties = PropertyReader.read_many(reader) 2155 elif tag == 'data_center': 2156 obj.data_center = DataCenterReader.read_one(reader) 2157 elif tag == 'description': 2158 obj.description = Reader.read_string(reader) 2159 elif tag == 'display': 2160 obj.display = DisplayReader.read_one(reader) 2161 elif tag == 'enabled_features': 2162 obj.enabled_features = ClusterFeatureReader.read_many(reader) 2163 elif tag == 'error_handling': 2164 obj.error_handling = ErrorHandlingReader.read_one(reader) 2165 elif tag == 'external_network_providers': 2166 obj.external_network_providers = ExternalProviderReader.read_many(reader) 2167 elif tag == 'fencing_policy': 2168 obj.fencing_policy = FencingPolicyReader.read_one(reader) 2169 elif tag == 'fips_mode': 2170 obj.fips_mode = Reader.read_enum(types.FipsMode, reader) 2171 elif tag == 'firewall_type': 2172 obj.firewall_type = Reader.read_enum(types.FirewallType, reader) 2173 elif tag == 'gluster_hooks': 2174 obj.gluster_hooks = GlusterHookReader.read_many(reader) 2175 elif tag == 'gluster_service': 2176 obj.gluster_service = Reader.read_boolean(reader) 2177 elif tag == 'gluster_tuned_profile': 2178 obj.gluster_tuned_profile = Reader.read_string(reader) 2179 elif tag == 'gluster_volumes': 2180 obj.gluster_volumes = GlusterVolumeReader.read_many(reader) 2181 elif tag == 'ha_reservation': 2182 obj.ha_reservation = Reader.read_boolean(reader) 2183 elif tag == 'ksm': 2184 obj.ksm = KsmReader.read_one(reader) 2185 elif tag == 'log_max_memory_used_threshold': 2186 obj.log_max_memory_used_threshold = Reader.read_integer(reader) 2187 elif tag == 'log_max_memory_used_threshold_type': 2188 obj.log_max_memory_used_threshold_type = Reader.read_enum(types.LogMaxMemoryUsedThresholdType, reader) 2189 elif tag == 'mac_pool': 2190 obj.mac_pool = MacPoolReader.read_one(reader) 2191 elif tag == 'maintenance_reason_required': 2192 obj.maintenance_reason_required = Reader.read_boolean(reader) 2193 elif tag == 'management_network': 2194 obj.management_network = NetworkReader.read_one(reader) 2195 elif tag == 'memory_policy': 2196 obj.memory_policy = MemoryPolicyReader.read_one(reader) 2197 elif tag == 'migration': 2198 obj.migration = MigrationOptionsReader.read_one(reader) 2199 elif tag == 'name': 2200 obj.name = Reader.read_string(reader) 2201 elif tag == 'network_filters': 2202 obj.network_filters = NetworkFilterReader.read_many(reader) 2203 elif tag == 'networks': 2204 obj.networks = NetworkReader.read_many(reader) 2205 elif tag == 'optional_reason': 2206 obj.optional_reason = Reader.read_boolean(reader) 2207 elif tag == 'permissions': 2208 obj.permissions = PermissionReader.read_many(reader) 2209 elif tag == 'required_rng_sources': 2210 obj.required_rng_sources = Reader.read_enums(types.RngSource, reader) 2211 elif tag == 'scheduling_policy': 2212 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 2213 elif tag == 'serial_number': 2214 obj.serial_number = SerialNumberReader.read_one(reader) 2215 elif tag == 'supported_versions': 2216 obj.supported_versions = VersionReader.read_many(reader) 2217 elif tag == 'switch_type': 2218 obj.switch_type = Reader.read_enum(types.SwitchType, reader) 2219 elif tag == 'threads_as_cores': 2220 obj.threads_as_cores = Reader.read_boolean(reader) 2221 elif tag == 'trusted_service': 2222 obj.trusted_service = Reader.read_boolean(reader) 2223 elif tag == 'tunnel_migration': 2224 obj.tunnel_migration = Reader.read_boolean(reader) 2225 elif tag == 'upgrade_correlation_id': 2226 obj.upgrade_correlation_id = Reader.read_string(reader) 2227 elif tag == 'upgrade_in_progress': 2228 obj.upgrade_in_progress = Reader.read_boolean(reader) 2229 elif tag == 'upgrade_percent_complete': 2230 obj.upgrade_percent_complete = Reader.read_integer(reader) 2231 elif tag == 'version': 2232 obj.version = VersionReader.read_one(reader) 2233 elif tag == 'virt_service': 2234 obj.virt_service = Reader.read_boolean(reader) 2235 elif tag == 'vnc_encryption': 2236 obj.vnc_encryption = Reader.read_boolean(reader) 2237 elif tag == 'link': 2238 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2239 reader.next_element() 2240 else: 2241 reader.next_element() 2242 for link in links: 2243 ClusterReader._process_link(link, obj) 2244 2245 # Discard the end tag: 2246 reader.read() 2247 2248 return obj
2250 @staticmethod 2251 def read_many(reader): 2252 # Do nothing if there aren't more tags: 2253 objs = List() 2254 if not reader.forward(): 2255 return objs 2256 2257 # Process the attributes: 2258 objs.href = reader.get_attribute('href') 2259 2260 # Discard the start tag: 2261 empty = reader.empty_element() 2262 reader.read() 2263 if empty: 2264 return objs 2265 2266 # Process the inner elements: 2267 while reader.forward(): 2268 objs.append(ClusterReader.read_one(reader)) 2269 2270 # Discard the end tag: 2271 reader.read() 2272 2273 return objs
2328class ClusterFeatureReader(Reader): 2329 2330 def __init__(self): 2331 super(ClusterFeatureReader, self).__init__() 2332 2333 @staticmethod 2334 def read_one(reader): 2335 # Do nothing if there aren't more tags: 2336 if not reader.forward(): 2337 return None 2338 2339 # Create the object: 2340 obj = types.ClusterFeature() 2341 2342 # Process the attributes: 2343 obj.href = reader.get_attribute('href') 2344 value = reader.get_attribute('id') 2345 if value is not None: 2346 obj.id = value 2347 2348 # Discard the start tag: 2349 empty = reader.empty_element() 2350 reader.read() 2351 if empty: 2352 return obj 2353 2354 # Process the inner elements: 2355 links = [] 2356 while reader.forward(): 2357 tag = reader.node_name() 2358 if tag == 'cluster_level': 2359 obj.cluster_level = ClusterLevelReader.read_one(reader) 2360 elif tag == 'comment': 2361 obj.comment = Reader.read_string(reader) 2362 elif tag == 'description': 2363 obj.description = Reader.read_string(reader) 2364 elif tag == 'name': 2365 obj.name = Reader.read_string(reader) 2366 else: 2367 reader.next_element() 2368 for link in links: 2369 ClusterFeatureReader._process_link(link, obj) 2370 2371 # Discard the end tag: 2372 reader.read() 2373 2374 return obj 2375 2376 @staticmethod 2377 def read_many(reader): 2378 # Do nothing if there aren't more tags: 2379 objs = List() 2380 if not reader.forward(): 2381 return objs 2382 2383 # Process the attributes: 2384 objs.href = reader.get_attribute('href') 2385 2386 # Discard the start tag: 2387 empty = reader.empty_element() 2388 reader.read() 2389 if empty: 2390 return objs 2391 2392 # Process the inner elements: 2393 while reader.forward(): 2394 objs.append(ClusterFeatureReader.read_one(reader)) 2395 2396 # Discard the end tag: 2397 reader.read() 2398 2399 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2333 @staticmethod 2334 def read_one(reader): 2335 # Do nothing if there aren't more tags: 2336 if not reader.forward(): 2337 return None 2338 2339 # Create the object: 2340 obj = types.ClusterFeature() 2341 2342 # Process the attributes: 2343 obj.href = reader.get_attribute('href') 2344 value = reader.get_attribute('id') 2345 if value is not None: 2346 obj.id = value 2347 2348 # Discard the start tag: 2349 empty = reader.empty_element() 2350 reader.read() 2351 if empty: 2352 return obj 2353 2354 # Process the inner elements: 2355 links = [] 2356 while reader.forward(): 2357 tag = reader.node_name() 2358 if tag == 'cluster_level': 2359 obj.cluster_level = ClusterLevelReader.read_one(reader) 2360 elif tag == 'comment': 2361 obj.comment = Reader.read_string(reader) 2362 elif tag == 'description': 2363 obj.description = Reader.read_string(reader) 2364 elif tag == 'name': 2365 obj.name = Reader.read_string(reader) 2366 else: 2367 reader.next_element() 2368 for link in links: 2369 ClusterFeatureReader._process_link(link, obj) 2370 2371 # Discard the end tag: 2372 reader.read() 2373 2374 return obj
2376 @staticmethod 2377 def read_many(reader): 2378 # Do nothing if there aren't more tags: 2379 objs = List() 2380 if not reader.forward(): 2381 return objs 2382 2383 # Process the attributes: 2384 objs.href = reader.get_attribute('href') 2385 2386 # Discard the start tag: 2387 empty = reader.empty_element() 2388 reader.read() 2389 if empty: 2390 return objs 2391 2392 # Process the inner elements: 2393 while reader.forward(): 2394 objs.append(ClusterFeatureReader.read_one(reader)) 2395 2396 # Discard the end tag: 2397 reader.read() 2398 2399 return objs
2402class ClusterLevelReader(Reader): 2403 2404 def __init__(self): 2405 super(ClusterLevelReader, self).__init__() 2406 2407 @staticmethod 2408 def read_one(reader): 2409 # Do nothing if there aren't more tags: 2410 if not reader.forward(): 2411 return None 2412 2413 # Create the object: 2414 obj = types.ClusterLevel() 2415 2416 # Process the attributes: 2417 obj.href = reader.get_attribute('href') 2418 value = reader.get_attribute('id') 2419 if value is not None: 2420 obj.id = value 2421 2422 # Discard the start tag: 2423 empty = reader.empty_element() 2424 reader.read() 2425 if empty: 2426 return obj 2427 2428 # Process the inner elements: 2429 links = [] 2430 while reader.forward(): 2431 tag = reader.node_name() 2432 if tag == 'cluster_features': 2433 obj.cluster_features = ClusterFeatureReader.read_many(reader) 2434 elif tag == 'comment': 2435 obj.comment = Reader.read_string(reader) 2436 elif tag == 'cpu_types': 2437 obj.cpu_types = CpuTypeReader.read_many(reader) 2438 elif tag == 'description': 2439 obj.description = Reader.read_string(reader) 2440 elif tag == 'name': 2441 obj.name = Reader.read_string(reader) 2442 elif tag == 'permits': 2443 obj.permits = PermitReader.read_many(reader) 2444 elif tag == 'link': 2445 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2446 reader.next_element() 2447 else: 2448 reader.next_element() 2449 for link in links: 2450 ClusterLevelReader._process_link(link, obj) 2451 2452 # Discard the end tag: 2453 reader.read() 2454 2455 return obj 2456 2457 @staticmethod 2458 def read_many(reader): 2459 # Do nothing if there aren't more tags: 2460 objs = List() 2461 if not reader.forward(): 2462 return objs 2463 2464 # Process the attributes: 2465 objs.href = reader.get_attribute('href') 2466 2467 # Discard the start tag: 2468 empty = reader.empty_element() 2469 reader.read() 2470 if empty: 2471 return objs 2472 2473 # Process the inner elements: 2474 while reader.forward(): 2475 objs.append(ClusterLevelReader.read_one(reader)) 2476 2477 # Discard the end tag: 2478 reader.read() 2479 2480 return objs 2481 2482 @staticmethod 2483 def _process_link(link, obj): 2484 # Process the attributes: 2485 rel = link[0] 2486 href = link[1] 2487 if href and rel: 2488 if rel == "clusterfeatures": 2489 if obj.cluster_features is not None: 2490 obj.cluster_features.href = href 2491 else: 2492 obj.cluster_features = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2407 @staticmethod 2408 def read_one(reader): 2409 # Do nothing if there aren't more tags: 2410 if not reader.forward(): 2411 return None 2412 2413 # Create the object: 2414 obj = types.ClusterLevel() 2415 2416 # Process the attributes: 2417 obj.href = reader.get_attribute('href') 2418 value = reader.get_attribute('id') 2419 if value is not None: 2420 obj.id = value 2421 2422 # Discard the start tag: 2423 empty = reader.empty_element() 2424 reader.read() 2425 if empty: 2426 return obj 2427 2428 # Process the inner elements: 2429 links = [] 2430 while reader.forward(): 2431 tag = reader.node_name() 2432 if tag == 'cluster_features': 2433 obj.cluster_features = ClusterFeatureReader.read_many(reader) 2434 elif tag == 'comment': 2435 obj.comment = Reader.read_string(reader) 2436 elif tag == 'cpu_types': 2437 obj.cpu_types = CpuTypeReader.read_many(reader) 2438 elif tag == 'description': 2439 obj.description = Reader.read_string(reader) 2440 elif tag == 'name': 2441 obj.name = Reader.read_string(reader) 2442 elif tag == 'permits': 2443 obj.permits = PermitReader.read_many(reader) 2444 elif tag == 'link': 2445 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2446 reader.next_element() 2447 else: 2448 reader.next_element() 2449 for link in links: 2450 ClusterLevelReader._process_link(link, obj) 2451 2452 # Discard the end tag: 2453 reader.read() 2454 2455 return obj
2457 @staticmethod 2458 def read_many(reader): 2459 # Do nothing if there aren't more tags: 2460 objs = List() 2461 if not reader.forward(): 2462 return objs 2463 2464 # Process the attributes: 2465 objs.href = reader.get_attribute('href') 2466 2467 # Discard the start tag: 2468 empty = reader.empty_element() 2469 reader.read() 2470 if empty: 2471 return objs 2472 2473 # Process the inner elements: 2474 while reader.forward(): 2475 objs.append(ClusterLevelReader.read_one(reader)) 2476 2477 # Discard the end tag: 2478 reader.read() 2479 2480 return objs
2495class ConfigurationReader(Reader): 2496 2497 def __init__(self): 2498 super(ConfigurationReader, self).__init__() 2499 2500 @staticmethod 2501 def read_one(reader): 2502 # Do nothing if there aren't more tags: 2503 if not reader.forward(): 2504 return None 2505 2506 # Create the object: 2507 obj = types.Configuration() 2508 2509 # Process the attributes: 2510 obj.href = reader.get_attribute('href') 2511 2512 # Discard the start tag: 2513 empty = reader.empty_element() 2514 reader.read() 2515 if empty: 2516 return obj 2517 2518 # Process the inner elements: 2519 links = [] 2520 while reader.forward(): 2521 tag = reader.node_name() 2522 if tag == 'data': 2523 obj.data = Reader.read_string(reader) 2524 elif tag == 'type': 2525 obj.type = Reader.read_enum(types.ConfigurationType, reader) 2526 else: 2527 reader.next_element() 2528 for link in links: 2529 ConfigurationReader._process_link(link, obj) 2530 2531 # Discard the end tag: 2532 reader.read() 2533 2534 return obj 2535 2536 @staticmethod 2537 def read_many(reader): 2538 # Do nothing if there aren't more tags: 2539 objs = List() 2540 if not reader.forward(): 2541 return objs 2542 2543 # Process the attributes: 2544 objs.href = reader.get_attribute('href') 2545 2546 # Discard the start tag: 2547 empty = reader.empty_element() 2548 reader.read() 2549 if empty: 2550 return objs 2551 2552 # Process the inner elements: 2553 while reader.forward(): 2554 objs.append(ConfigurationReader.read_one(reader)) 2555 2556 # Discard the end tag: 2557 reader.read() 2558 2559 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2500 @staticmethod 2501 def read_one(reader): 2502 # Do nothing if there aren't more tags: 2503 if not reader.forward(): 2504 return None 2505 2506 # Create the object: 2507 obj = types.Configuration() 2508 2509 # Process the attributes: 2510 obj.href = reader.get_attribute('href') 2511 2512 # Discard the start tag: 2513 empty = reader.empty_element() 2514 reader.read() 2515 if empty: 2516 return obj 2517 2518 # Process the inner elements: 2519 links = [] 2520 while reader.forward(): 2521 tag = reader.node_name() 2522 if tag == 'data': 2523 obj.data = Reader.read_string(reader) 2524 elif tag == 'type': 2525 obj.type = Reader.read_enum(types.ConfigurationType, reader) 2526 else: 2527 reader.next_element() 2528 for link in links: 2529 ConfigurationReader._process_link(link, obj) 2530 2531 # Discard the end tag: 2532 reader.read() 2533 2534 return obj
2536 @staticmethod 2537 def read_many(reader): 2538 # Do nothing if there aren't more tags: 2539 objs = List() 2540 if not reader.forward(): 2541 return objs 2542 2543 # Process the attributes: 2544 objs.href = reader.get_attribute('href') 2545 2546 # Discard the start tag: 2547 empty = reader.empty_element() 2548 reader.read() 2549 if empty: 2550 return objs 2551 2552 # Process the inner elements: 2553 while reader.forward(): 2554 objs.append(ConfigurationReader.read_one(reader)) 2555 2556 # Discard the end tag: 2557 reader.read() 2558 2559 return objs
2562class ConsoleReader(Reader): 2563 2564 def __init__(self): 2565 super(ConsoleReader, self).__init__() 2566 2567 @staticmethod 2568 def read_one(reader): 2569 # Do nothing if there aren't more tags: 2570 if not reader.forward(): 2571 return None 2572 2573 # Create the object: 2574 obj = types.Console() 2575 2576 # Process the attributes: 2577 obj.href = reader.get_attribute('href') 2578 2579 # Discard the start tag: 2580 empty = reader.empty_element() 2581 reader.read() 2582 if empty: 2583 return obj 2584 2585 # Process the inner elements: 2586 links = [] 2587 while reader.forward(): 2588 tag = reader.node_name() 2589 if tag == 'enabled': 2590 obj.enabled = Reader.read_boolean(reader) 2591 else: 2592 reader.next_element() 2593 for link in links: 2594 ConsoleReader._process_link(link, obj) 2595 2596 # Discard the end tag: 2597 reader.read() 2598 2599 return obj 2600 2601 @staticmethod 2602 def read_many(reader): 2603 # Do nothing if there aren't more tags: 2604 objs = List() 2605 if not reader.forward(): 2606 return objs 2607 2608 # Process the attributes: 2609 objs.href = reader.get_attribute('href') 2610 2611 # Discard the start tag: 2612 empty = reader.empty_element() 2613 reader.read() 2614 if empty: 2615 return objs 2616 2617 # Process the inner elements: 2618 while reader.forward(): 2619 objs.append(ConsoleReader.read_one(reader)) 2620 2621 # Discard the end tag: 2622 reader.read() 2623 2624 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2567 @staticmethod 2568 def read_one(reader): 2569 # Do nothing if there aren't more tags: 2570 if not reader.forward(): 2571 return None 2572 2573 # Create the object: 2574 obj = types.Console() 2575 2576 # Process the attributes: 2577 obj.href = reader.get_attribute('href') 2578 2579 # Discard the start tag: 2580 empty = reader.empty_element() 2581 reader.read() 2582 if empty: 2583 return obj 2584 2585 # Process the inner elements: 2586 links = [] 2587 while reader.forward(): 2588 tag = reader.node_name() 2589 if tag == 'enabled': 2590 obj.enabled = Reader.read_boolean(reader) 2591 else: 2592 reader.next_element() 2593 for link in links: 2594 ConsoleReader._process_link(link, obj) 2595 2596 # Discard the end tag: 2597 reader.read() 2598 2599 return obj
2601 @staticmethod 2602 def read_many(reader): 2603 # Do nothing if there aren't more tags: 2604 objs = List() 2605 if not reader.forward(): 2606 return objs 2607 2608 # Process the attributes: 2609 objs.href = reader.get_attribute('href') 2610 2611 # Discard the start tag: 2612 empty = reader.empty_element() 2613 reader.read() 2614 if empty: 2615 return objs 2616 2617 # Process the inner elements: 2618 while reader.forward(): 2619 objs.append(ConsoleReader.read_one(reader)) 2620 2621 # Discard the end tag: 2622 reader.read() 2623 2624 return objs
2627class CoreReader(Reader): 2628 2629 def __init__(self): 2630 super(CoreReader, self).__init__() 2631 2632 @staticmethod 2633 def read_one(reader): 2634 # Do nothing if there aren't more tags: 2635 if not reader.forward(): 2636 return None 2637 2638 # Create the object: 2639 obj = types.Core() 2640 2641 # Process the attributes: 2642 obj.href = reader.get_attribute('href') 2643 2644 # Discard the start tag: 2645 empty = reader.empty_element() 2646 reader.read() 2647 if empty: 2648 return obj 2649 2650 # Process the inner elements: 2651 links = [] 2652 while reader.forward(): 2653 tag = reader.node_name() 2654 if tag == 'index': 2655 obj.index = Reader.read_integer(reader) 2656 elif tag == 'socket': 2657 obj.socket = Reader.read_integer(reader) 2658 else: 2659 reader.next_element() 2660 for link in links: 2661 CoreReader._process_link(link, obj) 2662 2663 # Discard the end tag: 2664 reader.read() 2665 2666 return obj 2667 2668 @staticmethod 2669 def read_many(reader): 2670 # Do nothing if there aren't more tags: 2671 objs = List() 2672 if not reader.forward(): 2673 return objs 2674 2675 # Process the attributes: 2676 objs.href = reader.get_attribute('href') 2677 2678 # Discard the start tag: 2679 empty = reader.empty_element() 2680 reader.read() 2681 if empty: 2682 return objs 2683 2684 # Process the inner elements: 2685 while reader.forward(): 2686 objs.append(CoreReader.read_one(reader)) 2687 2688 # Discard the end tag: 2689 reader.read() 2690 2691 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2632 @staticmethod 2633 def read_one(reader): 2634 # Do nothing if there aren't more tags: 2635 if not reader.forward(): 2636 return None 2637 2638 # Create the object: 2639 obj = types.Core() 2640 2641 # Process the attributes: 2642 obj.href = reader.get_attribute('href') 2643 2644 # Discard the start tag: 2645 empty = reader.empty_element() 2646 reader.read() 2647 if empty: 2648 return obj 2649 2650 # Process the inner elements: 2651 links = [] 2652 while reader.forward(): 2653 tag = reader.node_name() 2654 if tag == 'index': 2655 obj.index = Reader.read_integer(reader) 2656 elif tag == 'socket': 2657 obj.socket = Reader.read_integer(reader) 2658 else: 2659 reader.next_element() 2660 for link in links: 2661 CoreReader._process_link(link, obj) 2662 2663 # Discard the end tag: 2664 reader.read() 2665 2666 return obj
2668 @staticmethod 2669 def read_many(reader): 2670 # Do nothing if there aren't more tags: 2671 objs = List() 2672 if not reader.forward(): 2673 return objs 2674 2675 # Process the attributes: 2676 objs.href = reader.get_attribute('href') 2677 2678 # Discard the start tag: 2679 empty = reader.empty_element() 2680 reader.read() 2681 if empty: 2682 return objs 2683 2684 # Process the inner elements: 2685 while reader.forward(): 2686 objs.append(CoreReader.read_one(reader)) 2687 2688 # Discard the end tag: 2689 reader.read() 2690 2691 return objs
2694class CpuReader(Reader): 2695 2696 def __init__(self): 2697 super(CpuReader, self).__init__() 2698 2699 @staticmethod 2700 def read_one(reader): 2701 # Do nothing if there aren't more tags: 2702 if not reader.forward(): 2703 return None 2704 2705 # Create the object: 2706 obj = types.Cpu() 2707 2708 # Process the attributes: 2709 obj.href = reader.get_attribute('href') 2710 2711 # Discard the start tag: 2712 empty = reader.empty_element() 2713 reader.read() 2714 if empty: 2715 return obj 2716 2717 # Process the inner elements: 2718 links = [] 2719 while reader.forward(): 2720 tag = reader.node_name() 2721 if tag == 'architecture': 2722 obj.architecture = Reader.read_enum(types.Architecture, reader) 2723 elif tag == 'cores': 2724 obj.cores = CoreReader.read_many(reader) 2725 elif tag == 'cpu_tune': 2726 obj.cpu_tune = CpuTuneReader.read_one(reader) 2727 elif tag == 'level': 2728 obj.level = Reader.read_integer(reader) 2729 elif tag == 'mode': 2730 obj.mode = Reader.read_enum(types.CpuMode, reader) 2731 elif tag == 'name': 2732 obj.name = Reader.read_string(reader) 2733 elif tag == 'speed': 2734 obj.speed = Reader.read_decimal(reader) 2735 elif tag == 'topology': 2736 obj.topology = CpuTopologyReader.read_one(reader) 2737 elif tag == 'type': 2738 obj.type = Reader.read_string(reader) 2739 else: 2740 reader.next_element() 2741 for link in links: 2742 CpuReader._process_link(link, obj) 2743 2744 # Discard the end tag: 2745 reader.read() 2746 2747 return obj 2748 2749 @staticmethod 2750 def read_many(reader): 2751 # Do nothing if there aren't more tags: 2752 objs = List() 2753 if not reader.forward(): 2754 return objs 2755 2756 # Process the attributes: 2757 objs.href = reader.get_attribute('href') 2758 2759 # Discard the start tag: 2760 empty = reader.empty_element() 2761 reader.read() 2762 if empty: 2763 return objs 2764 2765 # Process the inner elements: 2766 while reader.forward(): 2767 objs.append(CpuReader.read_one(reader)) 2768 2769 # Discard the end tag: 2770 reader.read() 2771 2772 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2699 @staticmethod 2700 def read_one(reader): 2701 # Do nothing if there aren't more tags: 2702 if not reader.forward(): 2703 return None 2704 2705 # Create the object: 2706 obj = types.Cpu() 2707 2708 # Process the attributes: 2709 obj.href = reader.get_attribute('href') 2710 2711 # Discard the start tag: 2712 empty = reader.empty_element() 2713 reader.read() 2714 if empty: 2715 return obj 2716 2717 # Process the inner elements: 2718 links = [] 2719 while reader.forward(): 2720 tag = reader.node_name() 2721 if tag == 'architecture': 2722 obj.architecture = Reader.read_enum(types.Architecture, reader) 2723 elif tag == 'cores': 2724 obj.cores = CoreReader.read_many(reader) 2725 elif tag == 'cpu_tune': 2726 obj.cpu_tune = CpuTuneReader.read_one(reader) 2727 elif tag == 'level': 2728 obj.level = Reader.read_integer(reader) 2729 elif tag == 'mode': 2730 obj.mode = Reader.read_enum(types.CpuMode, reader) 2731 elif tag == 'name': 2732 obj.name = Reader.read_string(reader) 2733 elif tag == 'speed': 2734 obj.speed = Reader.read_decimal(reader) 2735 elif tag == 'topology': 2736 obj.topology = CpuTopologyReader.read_one(reader) 2737 elif tag == 'type': 2738 obj.type = Reader.read_string(reader) 2739 else: 2740 reader.next_element() 2741 for link in links: 2742 CpuReader._process_link(link, obj) 2743 2744 # Discard the end tag: 2745 reader.read() 2746 2747 return obj
2749 @staticmethod 2750 def read_many(reader): 2751 # Do nothing if there aren't more tags: 2752 objs = List() 2753 if not reader.forward(): 2754 return objs 2755 2756 # Process the attributes: 2757 objs.href = reader.get_attribute('href') 2758 2759 # Discard the start tag: 2760 empty = reader.empty_element() 2761 reader.read() 2762 if empty: 2763 return objs 2764 2765 # Process the inner elements: 2766 while reader.forward(): 2767 objs.append(CpuReader.read_one(reader)) 2768 2769 # Discard the end tag: 2770 reader.read() 2771 2772 return objs
2775class CpuProfileReader(Reader): 2776 2777 def __init__(self): 2778 super(CpuProfileReader, self).__init__() 2779 2780 @staticmethod 2781 def read_one(reader): 2782 # Do nothing if there aren't more tags: 2783 if not reader.forward(): 2784 return None 2785 2786 # Create the object: 2787 obj = types.CpuProfile() 2788 2789 # Process the attributes: 2790 obj.href = reader.get_attribute('href') 2791 value = reader.get_attribute('id') 2792 if value is not None: 2793 obj.id = value 2794 2795 # Discard the start tag: 2796 empty = reader.empty_element() 2797 reader.read() 2798 if empty: 2799 return obj 2800 2801 # Process the inner elements: 2802 links = [] 2803 while reader.forward(): 2804 tag = reader.node_name() 2805 if tag == 'cluster': 2806 obj.cluster = ClusterReader.read_one(reader) 2807 elif tag == 'comment': 2808 obj.comment = Reader.read_string(reader) 2809 elif tag == 'description': 2810 obj.description = Reader.read_string(reader) 2811 elif tag == 'name': 2812 obj.name = Reader.read_string(reader) 2813 elif tag == 'permissions': 2814 obj.permissions = PermissionReader.read_many(reader) 2815 elif tag == 'qos': 2816 obj.qos = QosReader.read_one(reader) 2817 elif tag == 'link': 2818 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2819 reader.next_element() 2820 else: 2821 reader.next_element() 2822 for link in links: 2823 CpuProfileReader._process_link(link, obj) 2824 2825 # Discard the end tag: 2826 reader.read() 2827 2828 return obj 2829 2830 @staticmethod 2831 def read_many(reader): 2832 # Do nothing if there aren't more tags: 2833 objs = List() 2834 if not reader.forward(): 2835 return objs 2836 2837 # Process the attributes: 2838 objs.href = reader.get_attribute('href') 2839 2840 # Discard the start tag: 2841 empty = reader.empty_element() 2842 reader.read() 2843 if empty: 2844 return objs 2845 2846 # Process the inner elements: 2847 while reader.forward(): 2848 objs.append(CpuProfileReader.read_one(reader)) 2849 2850 # Discard the end tag: 2851 reader.read() 2852 2853 return objs 2854 2855 @staticmethod 2856 def _process_link(link, obj): 2857 # Process the attributes: 2858 rel = link[0] 2859 href = link[1] 2860 if href and rel: 2861 if rel == "permissions": 2862 if obj.permissions is not None: 2863 obj.permissions.href = href 2864 else: 2865 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2780 @staticmethod 2781 def read_one(reader): 2782 # Do nothing if there aren't more tags: 2783 if not reader.forward(): 2784 return None 2785 2786 # Create the object: 2787 obj = types.CpuProfile() 2788 2789 # Process the attributes: 2790 obj.href = reader.get_attribute('href') 2791 value = reader.get_attribute('id') 2792 if value is not None: 2793 obj.id = value 2794 2795 # Discard the start tag: 2796 empty = reader.empty_element() 2797 reader.read() 2798 if empty: 2799 return obj 2800 2801 # Process the inner elements: 2802 links = [] 2803 while reader.forward(): 2804 tag = reader.node_name() 2805 if tag == 'cluster': 2806 obj.cluster = ClusterReader.read_one(reader) 2807 elif tag == 'comment': 2808 obj.comment = Reader.read_string(reader) 2809 elif tag == 'description': 2810 obj.description = Reader.read_string(reader) 2811 elif tag == 'name': 2812 obj.name = Reader.read_string(reader) 2813 elif tag == 'permissions': 2814 obj.permissions = PermissionReader.read_many(reader) 2815 elif tag == 'qos': 2816 obj.qos = QosReader.read_one(reader) 2817 elif tag == 'link': 2818 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 2819 reader.next_element() 2820 else: 2821 reader.next_element() 2822 for link in links: 2823 CpuProfileReader._process_link(link, obj) 2824 2825 # Discard the end tag: 2826 reader.read() 2827 2828 return obj
2830 @staticmethod 2831 def read_many(reader): 2832 # Do nothing if there aren't more tags: 2833 objs = List() 2834 if not reader.forward(): 2835 return objs 2836 2837 # Process the attributes: 2838 objs.href = reader.get_attribute('href') 2839 2840 # Discard the start tag: 2841 empty = reader.empty_element() 2842 reader.read() 2843 if empty: 2844 return objs 2845 2846 # Process the inner elements: 2847 while reader.forward(): 2848 objs.append(CpuProfileReader.read_one(reader)) 2849 2850 # Discard the end tag: 2851 reader.read() 2852 2853 return objs
2868class CpuTopologyReader(Reader): 2869 2870 def __init__(self): 2871 super(CpuTopologyReader, self).__init__() 2872 2873 @staticmethod 2874 def read_one(reader): 2875 # Do nothing if there aren't more tags: 2876 if not reader.forward(): 2877 return None 2878 2879 # Create the object: 2880 obj = types.CpuTopology() 2881 2882 # Process the attributes: 2883 obj.href = reader.get_attribute('href') 2884 2885 # Discard the start tag: 2886 empty = reader.empty_element() 2887 reader.read() 2888 if empty: 2889 return obj 2890 2891 # Process the inner elements: 2892 links = [] 2893 while reader.forward(): 2894 tag = reader.node_name() 2895 if tag == 'cores': 2896 obj.cores = Reader.read_integer(reader) 2897 elif tag == 'sockets': 2898 obj.sockets = Reader.read_integer(reader) 2899 elif tag == 'threads': 2900 obj.threads = Reader.read_integer(reader) 2901 else: 2902 reader.next_element() 2903 for link in links: 2904 CpuTopologyReader._process_link(link, obj) 2905 2906 # Discard the end tag: 2907 reader.read() 2908 2909 return obj 2910 2911 @staticmethod 2912 def read_many(reader): 2913 # Do nothing if there aren't more tags: 2914 objs = List() 2915 if not reader.forward(): 2916 return objs 2917 2918 # Process the attributes: 2919 objs.href = reader.get_attribute('href') 2920 2921 # Discard the start tag: 2922 empty = reader.empty_element() 2923 reader.read() 2924 if empty: 2925 return objs 2926 2927 # Process the inner elements: 2928 while reader.forward(): 2929 objs.append(CpuTopologyReader.read_one(reader)) 2930 2931 # Discard the end tag: 2932 reader.read() 2933 2934 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2873 @staticmethod 2874 def read_one(reader): 2875 # Do nothing if there aren't more tags: 2876 if not reader.forward(): 2877 return None 2878 2879 # Create the object: 2880 obj = types.CpuTopology() 2881 2882 # Process the attributes: 2883 obj.href = reader.get_attribute('href') 2884 2885 # Discard the start tag: 2886 empty = reader.empty_element() 2887 reader.read() 2888 if empty: 2889 return obj 2890 2891 # Process the inner elements: 2892 links = [] 2893 while reader.forward(): 2894 tag = reader.node_name() 2895 if tag == 'cores': 2896 obj.cores = Reader.read_integer(reader) 2897 elif tag == 'sockets': 2898 obj.sockets = Reader.read_integer(reader) 2899 elif tag == 'threads': 2900 obj.threads = Reader.read_integer(reader) 2901 else: 2902 reader.next_element() 2903 for link in links: 2904 CpuTopologyReader._process_link(link, obj) 2905 2906 # Discard the end tag: 2907 reader.read() 2908 2909 return obj
2911 @staticmethod 2912 def read_many(reader): 2913 # Do nothing if there aren't more tags: 2914 objs = List() 2915 if not reader.forward(): 2916 return objs 2917 2918 # Process the attributes: 2919 objs.href = reader.get_attribute('href') 2920 2921 # Discard the start tag: 2922 empty = reader.empty_element() 2923 reader.read() 2924 if empty: 2925 return objs 2926 2927 # Process the inner elements: 2928 while reader.forward(): 2929 objs.append(CpuTopologyReader.read_one(reader)) 2930 2931 # Discard the end tag: 2932 reader.read() 2933 2934 return objs
2937class CpuTuneReader(Reader): 2938 2939 def __init__(self): 2940 super(CpuTuneReader, self).__init__() 2941 2942 @staticmethod 2943 def read_one(reader): 2944 # Do nothing if there aren't more tags: 2945 if not reader.forward(): 2946 return None 2947 2948 # Create the object: 2949 obj = types.CpuTune() 2950 2951 # Process the attributes: 2952 obj.href = reader.get_attribute('href') 2953 2954 # Discard the start tag: 2955 empty = reader.empty_element() 2956 reader.read() 2957 if empty: 2958 return obj 2959 2960 # Process the inner elements: 2961 links = [] 2962 while reader.forward(): 2963 tag = reader.node_name() 2964 if tag == 'vcpu_pins': 2965 obj.vcpu_pins = VcpuPinReader.read_many(reader) 2966 else: 2967 reader.next_element() 2968 for link in links: 2969 CpuTuneReader._process_link(link, obj) 2970 2971 # Discard the end tag: 2972 reader.read() 2973 2974 return obj 2975 2976 @staticmethod 2977 def read_many(reader): 2978 # Do nothing if there aren't more tags: 2979 objs = List() 2980 if not reader.forward(): 2981 return objs 2982 2983 # Process the attributes: 2984 objs.href = reader.get_attribute('href') 2985 2986 # Discard the start tag: 2987 empty = reader.empty_element() 2988 reader.read() 2989 if empty: 2990 return objs 2991 2992 # Process the inner elements: 2993 while reader.forward(): 2994 objs.append(CpuTuneReader.read_one(reader)) 2995 2996 # Discard the end tag: 2997 reader.read() 2998 2999 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
2942 @staticmethod 2943 def read_one(reader): 2944 # Do nothing if there aren't more tags: 2945 if not reader.forward(): 2946 return None 2947 2948 # Create the object: 2949 obj = types.CpuTune() 2950 2951 # Process the attributes: 2952 obj.href = reader.get_attribute('href') 2953 2954 # Discard the start tag: 2955 empty = reader.empty_element() 2956 reader.read() 2957 if empty: 2958 return obj 2959 2960 # Process the inner elements: 2961 links = [] 2962 while reader.forward(): 2963 tag = reader.node_name() 2964 if tag == 'vcpu_pins': 2965 obj.vcpu_pins = VcpuPinReader.read_many(reader) 2966 else: 2967 reader.next_element() 2968 for link in links: 2969 CpuTuneReader._process_link(link, obj) 2970 2971 # Discard the end tag: 2972 reader.read() 2973 2974 return obj
2976 @staticmethod 2977 def read_many(reader): 2978 # Do nothing if there aren't more tags: 2979 objs = List() 2980 if not reader.forward(): 2981 return objs 2982 2983 # Process the attributes: 2984 objs.href = reader.get_attribute('href') 2985 2986 # Discard the start tag: 2987 empty = reader.empty_element() 2988 reader.read() 2989 if empty: 2990 return objs 2991 2992 # Process the inner elements: 2993 while reader.forward(): 2994 objs.append(CpuTuneReader.read_one(reader)) 2995 2996 # Discard the end tag: 2997 reader.read() 2998 2999 return objs
3002class CpuTypeReader(Reader): 3003 3004 def __init__(self): 3005 super(CpuTypeReader, self).__init__() 3006 3007 @staticmethod 3008 def read_one(reader): 3009 # Do nothing if there aren't more tags: 3010 if not reader.forward(): 3011 return None 3012 3013 # Create the object: 3014 obj = types.CpuType() 3015 3016 # Process the attributes: 3017 obj.href = reader.get_attribute('href') 3018 3019 # Discard the start tag: 3020 empty = reader.empty_element() 3021 reader.read() 3022 if empty: 3023 return obj 3024 3025 # Process the inner elements: 3026 links = [] 3027 while reader.forward(): 3028 tag = reader.node_name() 3029 if tag == 'architecture': 3030 obj.architecture = Reader.read_enum(types.Architecture, reader) 3031 elif tag == 'level': 3032 obj.level = Reader.read_integer(reader) 3033 elif tag == 'name': 3034 obj.name = Reader.read_string(reader) 3035 else: 3036 reader.next_element() 3037 for link in links: 3038 CpuTypeReader._process_link(link, obj) 3039 3040 # Discard the end tag: 3041 reader.read() 3042 3043 return obj 3044 3045 @staticmethod 3046 def read_many(reader): 3047 # Do nothing if there aren't more tags: 3048 objs = List() 3049 if not reader.forward(): 3050 return objs 3051 3052 # Process the attributes: 3053 objs.href = reader.get_attribute('href') 3054 3055 # Discard the start tag: 3056 empty = reader.empty_element() 3057 reader.read() 3058 if empty: 3059 return objs 3060 3061 # Process the inner elements: 3062 while reader.forward(): 3063 objs.append(CpuTypeReader.read_one(reader)) 3064 3065 # Discard the end tag: 3066 reader.read() 3067 3068 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3007 @staticmethod 3008 def read_one(reader): 3009 # Do nothing if there aren't more tags: 3010 if not reader.forward(): 3011 return None 3012 3013 # Create the object: 3014 obj = types.CpuType() 3015 3016 # Process the attributes: 3017 obj.href = reader.get_attribute('href') 3018 3019 # Discard the start tag: 3020 empty = reader.empty_element() 3021 reader.read() 3022 if empty: 3023 return obj 3024 3025 # Process the inner elements: 3026 links = [] 3027 while reader.forward(): 3028 tag = reader.node_name() 3029 if tag == 'architecture': 3030 obj.architecture = Reader.read_enum(types.Architecture, reader) 3031 elif tag == 'level': 3032 obj.level = Reader.read_integer(reader) 3033 elif tag == 'name': 3034 obj.name = Reader.read_string(reader) 3035 else: 3036 reader.next_element() 3037 for link in links: 3038 CpuTypeReader._process_link(link, obj) 3039 3040 # Discard the end tag: 3041 reader.read() 3042 3043 return obj
3045 @staticmethod 3046 def read_many(reader): 3047 # Do nothing if there aren't more tags: 3048 objs = List() 3049 if not reader.forward(): 3050 return objs 3051 3052 # Process the attributes: 3053 objs.href = reader.get_attribute('href') 3054 3055 # Discard the start tag: 3056 empty = reader.empty_element() 3057 reader.read() 3058 if empty: 3059 return objs 3060 3061 # Process the inner elements: 3062 while reader.forward(): 3063 objs.append(CpuTypeReader.read_one(reader)) 3064 3065 # Discard the end tag: 3066 reader.read() 3067 3068 return objs
3071class CustomPropertyReader(Reader): 3072 3073 def __init__(self): 3074 super(CustomPropertyReader, self).__init__() 3075 3076 @staticmethod 3077 def read_one(reader): 3078 # Do nothing if there aren't more tags: 3079 if not reader.forward(): 3080 return None 3081 3082 # Create the object: 3083 obj = types.CustomProperty() 3084 3085 # Process the attributes: 3086 obj.href = reader.get_attribute('href') 3087 3088 # Discard the start tag: 3089 empty = reader.empty_element() 3090 reader.read() 3091 if empty: 3092 return obj 3093 3094 # Process the inner elements: 3095 links = [] 3096 while reader.forward(): 3097 tag = reader.node_name() 3098 if tag == 'name': 3099 obj.name = Reader.read_string(reader) 3100 elif tag == 'regexp': 3101 obj.regexp = Reader.read_string(reader) 3102 elif tag == 'value': 3103 obj.value = Reader.read_string(reader) 3104 else: 3105 reader.next_element() 3106 for link in links: 3107 CustomPropertyReader._process_link(link, obj) 3108 3109 # Discard the end tag: 3110 reader.read() 3111 3112 return obj 3113 3114 @staticmethod 3115 def read_many(reader): 3116 # Do nothing if there aren't more tags: 3117 objs = List() 3118 if not reader.forward(): 3119 return objs 3120 3121 # Process the attributes: 3122 objs.href = reader.get_attribute('href') 3123 3124 # Discard the start tag: 3125 empty = reader.empty_element() 3126 reader.read() 3127 if empty: 3128 return objs 3129 3130 # Process the inner elements: 3131 while reader.forward(): 3132 objs.append(CustomPropertyReader.read_one(reader)) 3133 3134 # Discard the end tag: 3135 reader.read() 3136 3137 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3076 @staticmethod 3077 def read_one(reader): 3078 # Do nothing if there aren't more tags: 3079 if not reader.forward(): 3080 return None 3081 3082 # Create the object: 3083 obj = types.CustomProperty() 3084 3085 # Process the attributes: 3086 obj.href = reader.get_attribute('href') 3087 3088 # Discard the start tag: 3089 empty = reader.empty_element() 3090 reader.read() 3091 if empty: 3092 return obj 3093 3094 # Process the inner elements: 3095 links = [] 3096 while reader.forward(): 3097 tag = reader.node_name() 3098 if tag == 'name': 3099 obj.name = Reader.read_string(reader) 3100 elif tag == 'regexp': 3101 obj.regexp = Reader.read_string(reader) 3102 elif tag == 'value': 3103 obj.value = Reader.read_string(reader) 3104 else: 3105 reader.next_element() 3106 for link in links: 3107 CustomPropertyReader._process_link(link, obj) 3108 3109 # Discard the end tag: 3110 reader.read() 3111 3112 return obj
3114 @staticmethod 3115 def read_many(reader): 3116 # Do nothing if there aren't more tags: 3117 objs = List() 3118 if not reader.forward(): 3119 return objs 3120 3121 # Process the attributes: 3122 objs.href = reader.get_attribute('href') 3123 3124 # Discard the start tag: 3125 empty = reader.empty_element() 3126 reader.read() 3127 if empty: 3128 return objs 3129 3130 # Process the inner elements: 3131 while reader.forward(): 3132 objs.append(CustomPropertyReader.read_one(reader)) 3133 3134 # Discard the end tag: 3135 reader.read() 3136 3137 return objs
3140class DataCenterReader(Reader): 3141 3142 def __init__(self): 3143 super(DataCenterReader, self).__init__() 3144 3145 @staticmethod 3146 def read_one(reader): 3147 # Do nothing if there aren't more tags: 3148 if not reader.forward(): 3149 return None 3150 3151 # Create the object: 3152 obj = types.DataCenter() 3153 3154 # Process the attributes: 3155 obj.href = reader.get_attribute('href') 3156 value = reader.get_attribute('id') 3157 if value is not None: 3158 obj.id = value 3159 3160 # Discard the start tag: 3161 empty = reader.empty_element() 3162 reader.read() 3163 if empty: 3164 return obj 3165 3166 # Process the inner elements: 3167 links = [] 3168 while reader.forward(): 3169 tag = reader.node_name() 3170 if tag == 'clusters': 3171 obj.clusters = ClusterReader.read_many(reader) 3172 elif tag == 'comment': 3173 obj.comment = Reader.read_string(reader) 3174 elif tag == 'description': 3175 obj.description = Reader.read_string(reader) 3176 elif tag == 'iscsi_bonds': 3177 obj.iscsi_bonds = IscsiBondReader.read_many(reader) 3178 elif tag == 'local': 3179 obj.local = Reader.read_boolean(reader) 3180 elif tag == 'mac_pool': 3181 obj.mac_pool = MacPoolReader.read_one(reader) 3182 elif tag == 'name': 3183 obj.name = Reader.read_string(reader) 3184 elif tag == 'networks': 3185 obj.networks = NetworkReader.read_many(reader) 3186 elif tag == 'permissions': 3187 obj.permissions = PermissionReader.read_many(reader) 3188 elif tag == 'qoss': 3189 obj.qoss = QosReader.read_many(reader) 3190 elif tag == 'quota_mode': 3191 obj.quota_mode = Reader.read_enum(types.QuotaModeType, reader) 3192 elif tag == 'quotas': 3193 obj.quotas = QuotaReader.read_many(reader) 3194 elif tag == 'status': 3195 obj.status = Reader.read_enum(types.DataCenterStatus, reader) 3196 elif tag == 'storage_domains': 3197 obj.storage_domains = StorageDomainReader.read_many(reader) 3198 elif tag == 'storage_format': 3199 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 3200 elif tag == 'supported_versions': 3201 obj.supported_versions = VersionReader.read_many(reader) 3202 elif tag == 'version': 3203 obj.version = VersionReader.read_one(reader) 3204 elif tag == 'link': 3205 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3206 reader.next_element() 3207 else: 3208 reader.next_element() 3209 for link in links: 3210 DataCenterReader._process_link(link, obj) 3211 3212 # Discard the end tag: 3213 reader.read() 3214 3215 return obj 3216 3217 @staticmethod 3218 def read_many(reader): 3219 # Do nothing if there aren't more tags: 3220 objs = List() 3221 if not reader.forward(): 3222 return objs 3223 3224 # Process the attributes: 3225 objs.href = reader.get_attribute('href') 3226 3227 # Discard the start tag: 3228 empty = reader.empty_element() 3229 reader.read() 3230 if empty: 3231 return objs 3232 3233 # Process the inner elements: 3234 while reader.forward(): 3235 objs.append(DataCenterReader.read_one(reader)) 3236 3237 # Discard the end tag: 3238 reader.read() 3239 3240 return objs 3241 3242 @staticmethod 3243 def _process_link(link, obj): 3244 # Process the attributes: 3245 rel = link[0] 3246 href = link[1] 3247 if href and rel: 3248 if rel == "clusters": 3249 if obj.clusters is not None: 3250 obj.clusters.href = href 3251 else: 3252 obj.clusters = List(href) 3253 elif rel == "iscsibonds": 3254 if obj.iscsi_bonds is not None: 3255 obj.iscsi_bonds.href = href 3256 else: 3257 obj.iscsi_bonds = List(href) 3258 elif rel == "networks": 3259 if obj.networks is not None: 3260 obj.networks.href = href 3261 else: 3262 obj.networks = List(href) 3263 elif rel == "permissions": 3264 if obj.permissions is not None: 3265 obj.permissions.href = href 3266 else: 3267 obj.permissions = List(href) 3268 elif rel == "qoss": 3269 if obj.qoss is not None: 3270 obj.qoss.href = href 3271 else: 3272 obj.qoss = List(href) 3273 elif rel == "quotas": 3274 if obj.quotas is not None: 3275 obj.quotas.href = href 3276 else: 3277 obj.quotas = List(href) 3278 elif rel == "storagedomains": 3279 if obj.storage_domains is not None: 3280 obj.storage_domains.href = href 3281 else: 3282 obj.storage_domains = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3145 @staticmethod 3146 def read_one(reader): 3147 # Do nothing if there aren't more tags: 3148 if not reader.forward(): 3149 return None 3150 3151 # Create the object: 3152 obj = types.DataCenter() 3153 3154 # Process the attributes: 3155 obj.href = reader.get_attribute('href') 3156 value = reader.get_attribute('id') 3157 if value is not None: 3158 obj.id = value 3159 3160 # Discard the start tag: 3161 empty = reader.empty_element() 3162 reader.read() 3163 if empty: 3164 return obj 3165 3166 # Process the inner elements: 3167 links = [] 3168 while reader.forward(): 3169 tag = reader.node_name() 3170 if tag == 'clusters': 3171 obj.clusters = ClusterReader.read_many(reader) 3172 elif tag == 'comment': 3173 obj.comment = Reader.read_string(reader) 3174 elif tag == 'description': 3175 obj.description = Reader.read_string(reader) 3176 elif tag == 'iscsi_bonds': 3177 obj.iscsi_bonds = IscsiBondReader.read_many(reader) 3178 elif tag == 'local': 3179 obj.local = Reader.read_boolean(reader) 3180 elif tag == 'mac_pool': 3181 obj.mac_pool = MacPoolReader.read_one(reader) 3182 elif tag == 'name': 3183 obj.name = Reader.read_string(reader) 3184 elif tag == 'networks': 3185 obj.networks = NetworkReader.read_many(reader) 3186 elif tag == 'permissions': 3187 obj.permissions = PermissionReader.read_many(reader) 3188 elif tag == 'qoss': 3189 obj.qoss = QosReader.read_many(reader) 3190 elif tag == 'quota_mode': 3191 obj.quota_mode = Reader.read_enum(types.QuotaModeType, reader) 3192 elif tag == 'quotas': 3193 obj.quotas = QuotaReader.read_many(reader) 3194 elif tag == 'status': 3195 obj.status = Reader.read_enum(types.DataCenterStatus, reader) 3196 elif tag == 'storage_domains': 3197 obj.storage_domains = StorageDomainReader.read_many(reader) 3198 elif tag == 'storage_format': 3199 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 3200 elif tag == 'supported_versions': 3201 obj.supported_versions = VersionReader.read_many(reader) 3202 elif tag == 'version': 3203 obj.version = VersionReader.read_one(reader) 3204 elif tag == 'link': 3205 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3206 reader.next_element() 3207 else: 3208 reader.next_element() 3209 for link in links: 3210 DataCenterReader._process_link(link, obj) 3211 3212 # Discard the end tag: 3213 reader.read() 3214 3215 return obj
3217 @staticmethod 3218 def read_many(reader): 3219 # Do nothing if there aren't more tags: 3220 objs = List() 3221 if not reader.forward(): 3222 return objs 3223 3224 # Process the attributes: 3225 objs.href = reader.get_attribute('href') 3226 3227 # Discard the start tag: 3228 empty = reader.empty_element() 3229 reader.read() 3230 if empty: 3231 return objs 3232 3233 # Process the inner elements: 3234 while reader.forward(): 3235 objs.append(DataCenterReader.read_one(reader)) 3236 3237 # Discard the end tag: 3238 reader.read() 3239 3240 return objs
3285class DeviceReader(Reader): 3286 3287 def __init__(self): 3288 super(DeviceReader, self).__init__() 3289 3290 @staticmethod 3291 def read_one(reader): 3292 # Do nothing if there aren't more tags: 3293 if not reader.forward(): 3294 return None 3295 3296 # Create the object: 3297 obj = types.Device() 3298 3299 # Process the attributes: 3300 obj.href = reader.get_attribute('href') 3301 value = reader.get_attribute('id') 3302 if value is not None: 3303 obj.id = value 3304 3305 # Discard the start tag: 3306 empty = reader.empty_element() 3307 reader.read() 3308 if empty: 3309 return obj 3310 3311 # Process the inner elements: 3312 links = [] 3313 while reader.forward(): 3314 tag = reader.node_name() 3315 if tag == 'comment': 3316 obj.comment = Reader.read_string(reader) 3317 elif tag == 'description': 3318 obj.description = Reader.read_string(reader) 3319 elif tag == 'instance_type': 3320 obj.instance_type = InstanceTypeReader.read_one(reader) 3321 elif tag == 'name': 3322 obj.name = Reader.read_string(reader) 3323 elif tag == 'template': 3324 obj.template = TemplateReader.read_one(reader) 3325 elif tag == 'vm': 3326 obj.vm = VmReader.read_one(reader) 3327 elif tag == 'vms': 3328 obj.vms = VmReader.read_many(reader) 3329 elif tag == 'link': 3330 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3331 reader.next_element() 3332 else: 3333 reader.next_element() 3334 for link in links: 3335 DeviceReader._process_link(link, obj) 3336 3337 # Discard the end tag: 3338 reader.read() 3339 3340 return obj 3341 3342 @staticmethod 3343 def read_many(reader): 3344 # Do nothing if there aren't more tags: 3345 objs = List() 3346 if not reader.forward(): 3347 return objs 3348 3349 # Process the attributes: 3350 objs.href = reader.get_attribute('href') 3351 3352 # Discard the start tag: 3353 empty = reader.empty_element() 3354 reader.read() 3355 if empty: 3356 return objs 3357 3358 # Process the inner elements: 3359 while reader.forward(): 3360 objs.append(DeviceReader.read_one(reader)) 3361 3362 # Discard the end tag: 3363 reader.read() 3364 3365 return objs 3366 3367 @staticmethod 3368 def _process_link(link, obj): 3369 # Process the attributes: 3370 rel = link[0] 3371 href = link[1] 3372 if href and rel: 3373 if rel == "vms": 3374 if obj.vms is not None: 3375 obj.vms.href = href 3376 else: 3377 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3290 @staticmethod 3291 def read_one(reader): 3292 # Do nothing if there aren't more tags: 3293 if not reader.forward(): 3294 return None 3295 3296 # Create the object: 3297 obj = types.Device() 3298 3299 # Process the attributes: 3300 obj.href = reader.get_attribute('href') 3301 value = reader.get_attribute('id') 3302 if value is not None: 3303 obj.id = value 3304 3305 # Discard the start tag: 3306 empty = reader.empty_element() 3307 reader.read() 3308 if empty: 3309 return obj 3310 3311 # Process the inner elements: 3312 links = [] 3313 while reader.forward(): 3314 tag = reader.node_name() 3315 if tag == 'comment': 3316 obj.comment = Reader.read_string(reader) 3317 elif tag == 'description': 3318 obj.description = Reader.read_string(reader) 3319 elif tag == 'instance_type': 3320 obj.instance_type = InstanceTypeReader.read_one(reader) 3321 elif tag == 'name': 3322 obj.name = Reader.read_string(reader) 3323 elif tag == 'template': 3324 obj.template = TemplateReader.read_one(reader) 3325 elif tag == 'vm': 3326 obj.vm = VmReader.read_one(reader) 3327 elif tag == 'vms': 3328 obj.vms = VmReader.read_many(reader) 3329 elif tag == 'link': 3330 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3331 reader.next_element() 3332 else: 3333 reader.next_element() 3334 for link in links: 3335 DeviceReader._process_link(link, obj) 3336 3337 # Discard the end tag: 3338 reader.read() 3339 3340 return obj
3342 @staticmethod 3343 def read_many(reader): 3344 # Do nothing if there aren't more tags: 3345 objs = List() 3346 if not reader.forward(): 3347 return objs 3348 3349 # Process the attributes: 3350 objs.href = reader.get_attribute('href') 3351 3352 # Discard the start tag: 3353 empty = reader.empty_element() 3354 reader.read() 3355 if empty: 3356 return objs 3357 3358 # Process the inner elements: 3359 while reader.forward(): 3360 objs.append(DeviceReader.read_one(reader)) 3361 3362 # Discard the end tag: 3363 reader.read() 3364 3365 return objs
3380class DiskReader(Reader): 3381 3382 def __init__(self): 3383 super(DiskReader, self).__init__() 3384 3385 @staticmethod 3386 def read_one(reader): 3387 # Do nothing if there aren't more tags: 3388 if not reader.forward(): 3389 return None 3390 3391 # Create the object: 3392 obj = types.Disk() 3393 3394 # Process the attributes: 3395 obj.href = reader.get_attribute('href') 3396 value = reader.get_attribute('id') 3397 if value is not None: 3398 obj.id = value 3399 3400 # Discard the start tag: 3401 empty = reader.empty_element() 3402 reader.read() 3403 if empty: 3404 return obj 3405 3406 # Process the inner elements: 3407 links = [] 3408 while reader.forward(): 3409 tag = reader.node_name() 3410 if tag == 'active': 3411 obj.active = Reader.read_boolean(reader) 3412 elif tag == 'actual_size': 3413 obj.actual_size = Reader.read_integer(reader) 3414 elif tag == 'alias': 3415 obj.alias = Reader.read_string(reader) 3416 elif tag == 'backup': 3417 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3418 elif tag == 'backup_mode': 3419 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3420 elif tag == 'bootable': 3421 obj.bootable = Reader.read_boolean(reader) 3422 elif tag == 'comment': 3423 obj.comment = Reader.read_string(reader) 3424 elif tag == 'content_type': 3425 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3426 elif tag == 'description': 3427 obj.description = Reader.read_string(reader) 3428 elif tag == 'disk_profile': 3429 obj.disk_profile = DiskProfileReader.read_one(reader) 3430 elif tag == 'disk_snapshots': 3431 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3432 elif tag == 'external_disk': 3433 obj.external_disk = Reader.read_string(reader) 3434 elif tag == 'format': 3435 obj.format = Reader.read_enum(types.DiskFormat, reader) 3436 elif tag == 'image_id': 3437 obj.image_id = Reader.read_string(reader) 3438 elif tag == 'initial_size': 3439 obj.initial_size = Reader.read_integer(reader) 3440 elif tag == 'instance_type': 3441 obj.instance_type = InstanceTypeReader.read_one(reader) 3442 elif tag == 'interface': 3443 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3444 elif tag == 'logical_name': 3445 obj.logical_name = Reader.read_string(reader) 3446 elif tag == 'lun_storage': 3447 obj.lun_storage = HostStorageReader.read_one(reader) 3448 elif tag == 'name': 3449 obj.name = Reader.read_string(reader) 3450 elif tag == 'openstack_volume_type': 3451 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3452 elif tag == 'permissions': 3453 obj.permissions = PermissionReader.read_many(reader) 3454 elif tag == 'propagate_errors': 3455 obj.propagate_errors = Reader.read_boolean(reader) 3456 elif tag == 'provisioned_size': 3457 obj.provisioned_size = Reader.read_integer(reader) 3458 elif tag == 'qcow_version': 3459 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3460 elif tag == 'quota': 3461 obj.quota = QuotaReader.read_one(reader) 3462 elif tag == 'read_only': 3463 obj.read_only = Reader.read_boolean(reader) 3464 elif tag == 'sgio': 3465 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3466 elif tag == 'shareable': 3467 obj.shareable = Reader.read_boolean(reader) 3468 elif tag == 'snapshot': 3469 obj.snapshot = SnapshotReader.read_one(reader) 3470 elif tag == 'sparse': 3471 obj.sparse = Reader.read_boolean(reader) 3472 elif tag == 'statistics': 3473 obj.statistics = StatisticReader.read_many(reader) 3474 elif tag == 'status': 3475 obj.status = Reader.read_enum(types.DiskStatus, reader) 3476 elif tag == 'storage_domain': 3477 obj.storage_domain = StorageDomainReader.read_one(reader) 3478 elif tag == 'storage_domains': 3479 obj.storage_domains = StorageDomainReader.read_many(reader) 3480 elif tag == 'storage_type': 3481 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3482 elif tag == 'template': 3483 obj.template = TemplateReader.read_one(reader) 3484 elif tag == 'total_size': 3485 obj.total_size = Reader.read_integer(reader) 3486 elif tag == 'uses_scsi_reservation': 3487 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3488 elif tag == 'vm': 3489 obj.vm = VmReader.read_one(reader) 3490 elif tag == 'vms': 3491 obj.vms = VmReader.read_many(reader) 3492 elif tag == 'wipe_after_delete': 3493 obj.wipe_after_delete = Reader.read_boolean(reader) 3494 elif tag == 'link': 3495 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3496 reader.next_element() 3497 else: 3498 reader.next_element() 3499 for link in links: 3500 DiskReader._process_link(link, obj) 3501 3502 # Discard the end tag: 3503 reader.read() 3504 3505 return obj 3506 3507 @staticmethod 3508 def read_many(reader): 3509 # Do nothing if there aren't more tags: 3510 objs = List() 3511 if not reader.forward(): 3512 return objs 3513 3514 # Process the attributes: 3515 objs.href = reader.get_attribute('href') 3516 3517 # Discard the start tag: 3518 empty = reader.empty_element() 3519 reader.read() 3520 if empty: 3521 return objs 3522 3523 # Process the inner elements: 3524 while reader.forward(): 3525 objs.append(DiskReader.read_one(reader)) 3526 3527 # Discard the end tag: 3528 reader.read() 3529 3530 return objs 3531 3532 @staticmethod 3533 def _process_link(link, obj): 3534 # Process the attributes: 3535 rel = link[0] 3536 href = link[1] 3537 if href and rel: 3538 if rel == "disksnapshots": 3539 if obj.disk_snapshots is not None: 3540 obj.disk_snapshots.href = href 3541 else: 3542 obj.disk_snapshots = List(href) 3543 elif rel == "permissions": 3544 if obj.permissions is not None: 3545 obj.permissions.href = href 3546 else: 3547 obj.permissions = List(href) 3548 elif rel == "statistics": 3549 if obj.statistics is not None: 3550 obj.statistics.href = href 3551 else: 3552 obj.statistics = List(href) 3553 elif rel == "storagedomains": 3554 if obj.storage_domains is not None: 3555 obj.storage_domains.href = href 3556 else: 3557 obj.storage_domains = List(href) 3558 elif rel == "vms": 3559 if obj.vms is not None: 3560 obj.vms.href = href 3561 else: 3562 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3385 @staticmethod 3386 def read_one(reader): 3387 # Do nothing if there aren't more tags: 3388 if not reader.forward(): 3389 return None 3390 3391 # Create the object: 3392 obj = types.Disk() 3393 3394 # Process the attributes: 3395 obj.href = reader.get_attribute('href') 3396 value = reader.get_attribute('id') 3397 if value is not None: 3398 obj.id = value 3399 3400 # Discard the start tag: 3401 empty = reader.empty_element() 3402 reader.read() 3403 if empty: 3404 return obj 3405 3406 # Process the inner elements: 3407 links = [] 3408 while reader.forward(): 3409 tag = reader.node_name() 3410 if tag == 'active': 3411 obj.active = Reader.read_boolean(reader) 3412 elif tag == 'actual_size': 3413 obj.actual_size = Reader.read_integer(reader) 3414 elif tag == 'alias': 3415 obj.alias = Reader.read_string(reader) 3416 elif tag == 'backup': 3417 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3418 elif tag == 'backup_mode': 3419 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3420 elif tag == 'bootable': 3421 obj.bootable = Reader.read_boolean(reader) 3422 elif tag == 'comment': 3423 obj.comment = Reader.read_string(reader) 3424 elif tag == 'content_type': 3425 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3426 elif tag == 'description': 3427 obj.description = Reader.read_string(reader) 3428 elif tag == 'disk_profile': 3429 obj.disk_profile = DiskProfileReader.read_one(reader) 3430 elif tag == 'disk_snapshots': 3431 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3432 elif tag == 'external_disk': 3433 obj.external_disk = Reader.read_string(reader) 3434 elif tag == 'format': 3435 obj.format = Reader.read_enum(types.DiskFormat, reader) 3436 elif tag == 'image_id': 3437 obj.image_id = Reader.read_string(reader) 3438 elif tag == 'initial_size': 3439 obj.initial_size = Reader.read_integer(reader) 3440 elif tag == 'instance_type': 3441 obj.instance_type = InstanceTypeReader.read_one(reader) 3442 elif tag == 'interface': 3443 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3444 elif tag == 'logical_name': 3445 obj.logical_name = Reader.read_string(reader) 3446 elif tag == 'lun_storage': 3447 obj.lun_storage = HostStorageReader.read_one(reader) 3448 elif tag == 'name': 3449 obj.name = Reader.read_string(reader) 3450 elif tag == 'openstack_volume_type': 3451 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3452 elif tag == 'permissions': 3453 obj.permissions = PermissionReader.read_many(reader) 3454 elif tag == 'propagate_errors': 3455 obj.propagate_errors = Reader.read_boolean(reader) 3456 elif tag == 'provisioned_size': 3457 obj.provisioned_size = Reader.read_integer(reader) 3458 elif tag == 'qcow_version': 3459 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3460 elif tag == 'quota': 3461 obj.quota = QuotaReader.read_one(reader) 3462 elif tag == 'read_only': 3463 obj.read_only = Reader.read_boolean(reader) 3464 elif tag == 'sgio': 3465 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3466 elif tag == 'shareable': 3467 obj.shareable = Reader.read_boolean(reader) 3468 elif tag == 'snapshot': 3469 obj.snapshot = SnapshotReader.read_one(reader) 3470 elif tag == 'sparse': 3471 obj.sparse = Reader.read_boolean(reader) 3472 elif tag == 'statistics': 3473 obj.statistics = StatisticReader.read_many(reader) 3474 elif tag == 'status': 3475 obj.status = Reader.read_enum(types.DiskStatus, reader) 3476 elif tag == 'storage_domain': 3477 obj.storage_domain = StorageDomainReader.read_one(reader) 3478 elif tag == 'storage_domains': 3479 obj.storage_domains = StorageDomainReader.read_many(reader) 3480 elif tag == 'storage_type': 3481 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3482 elif tag == 'template': 3483 obj.template = TemplateReader.read_one(reader) 3484 elif tag == 'total_size': 3485 obj.total_size = Reader.read_integer(reader) 3486 elif tag == 'uses_scsi_reservation': 3487 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3488 elif tag == 'vm': 3489 obj.vm = VmReader.read_one(reader) 3490 elif tag == 'vms': 3491 obj.vms = VmReader.read_many(reader) 3492 elif tag == 'wipe_after_delete': 3493 obj.wipe_after_delete = Reader.read_boolean(reader) 3494 elif tag == 'link': 3495 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3496 reader.next_element() 3497 else: 3498 reader.next_element() 3499 for link in links: 3500 DiskReader._process_link(link, obj) 3501 3502 # Discard the end tag: 3503 reader.read() 3504 3505 return obj
3507 @staticmethod 3508 def read_many(reader): 3509 # Do nothing if there aren't more tags: 3510 objs = List() 3511 if not reader.forward(): 3512 return objs 3513 3514 # Process the attributes: 3515 objs.href = reader.get_attribute('href') 3516 3517 # Discard the start tag: 3518 empty = reader.empty_element() 3519 reader.read() 3520 if empty: 3521 return objs 3522 3523 # Process the inner elements: 3524 while reader.forward(): 3525 objs.append(DiskReader.read_one(reader)) 3526 3527 # Discard the end tag: 3528 reader.read() 3529 3530 return objs
3565class DiskAttachmentReader(Reader): 3566 3567 def __init__(self): 3568 super(DiskAttachmentReader, self).__init__() 3569 3570 @staticmethod 3571 def read_one(reader): 3572 # Do nothing if there aren't more tags: 3573 if not reader.forward(): 3574 return None 3575 3576 # Create the object: 3577 obj = types.DiskAttachment() 3578 3579 # Process the attributes: 3580 obj.href = reader.get_attribute('href') 3581 value = reader.get_attribute('id') 3582 if value is not None: 3583 obj.id = value 3584 3585 # Discard the start tag: 3586 empty = reader.empty_element() 3587 reader.read() 3588 if empty: 3589 return obj 3590 3591 # Process the inner elements: 3592 links = [] 3593 while reader.forward(): 3594 tag = reader.node_name() 3595 if tag == 'active': 3596 obj.active = Reader.read_boolean(reader) 3597 elif tag == 'bootable': 3598 obj.bootable = Reader.read_boolean(reader) 3599 elif tag == 'comment': 3600 obj.comment = Reader.read_string(reader) 3601 elif tag == 'description': 3602 obj.description = Reader.read_string(reader) 3603 elif tag == 'disk': 3604 obj.disk = DiskReader.read_one(reader) 3605 elif tag == 'interface': 3606 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3607 elif tag == 'logical_name': 3608 obj.logical_name = Reader.read_string(reader) 3609 elif tag == 'name': 3610 obj.name = Reader.read_string(reader) 3611 elif tag == 'pass_discard': 3612 obj.pass_discard = Reader.read_boolean(reader) 3613 elif tag == 'read_only': 3614 obj.read_only = Reader.read_boolean(reader) 3615 elif tag == 'template': 3616 obj.template = TemplateReader.read_one(reader) 3617 elif tag == 'uses_scsi_reservation': 3618 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3619 elif tag == 'vm': 3620 obj.vm = VmReader.read_one(reader) 3621 else: 3622 reader.next_element() 3623 for link in links: 3624 DiskAttachmentReader._process_link(link, obj) 3625 3626 # Discard the end tag: 3627 reader.read() 3628 3629 return obj 3630 3631 @staticmethod 3632 def read_many(reader): 3633 # Do nothing if there aren't more tags: 3634 objs = List() 3635 if not reader.forward(): 3636 return objs 3637 3638 # Process the attributes: 3639 objs.href = reader.get_attribute('href') 3640 3641 # Discard the start tag: 3642 empty = reader.empty_element() 3643 reader.read() 3644 if empty: 3645 return objs 3646 3647 # Process the inner elements: 3648 while reader.forward(): 3649 objs.append(DiskAttachmentReader.read_one(reader)) 3650 3651 # Discard the end tag: 3652 reader.read() 3653 3654 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3570 @staticmethod 3571 def read_one(reader): 3572 # Do nothing if there aren't more tags: 3573 if not reader.forward(): 3574 return None 3575 3576 # Create the object: 3577 obj = types.DiskAttachment() 3578 3579 # Process the attributes: 3580 obj.href = reader.get_attribute('href') 3581 value = reader.get_attribute('id') 3582 if value is not None: 3583 obj.id = value 3584 3585 # Discard the start tag: 3586 empty = reader.empty_element() 3587 reader.read() 3588 if empty: 3589 return obj 3590 3591 # Process the inner elements: 3592 links = [] 3593 while reader.forward(): 3594 tag = reader.node_name() 3595 if tag == 'active': 3596 obj.active = Reader.read_boolean(reader) 3597 elif tag == 'bootable': 3598 obj.bootable = Reader.read_boolean(reader) 3599 elif tag == 'comment': 3600 obj.comment = Reader.read_string(reader) 3601 elif tag == 'description': 3602 obj.description = Reader.read_string(reader) 3603 elif tag == 'disk': 3604 obj.disk = DiskReader.read_one(reader) 3605 elif tag == 'interface': 3606 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3607 elif tag == 'logical_name': 3608 obj.logical_name = Reader.read_string(reader) 3609 elif tag == 'name': 3610 obj.name = Reader.read_string(reader) 3611 elif tag == 'pass_discard': 3612 obj.pass_discard = Reader.read_boolean(reader) 3613 elif tag == 'read_only': 3614 obj.read_only = Reader.read_boolean(reader) 3615 elif tag == 'template': 3616 obj.template = TemplateReader.read_one(reader) 3617 elif tag == 'uses_scsi_reservation': 3618 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3619 elif tag == 'vm': 3620 obj.vm = VmReader.read_one(reader) 3621 else: 3622 reader.next_element() 3623 for link in links: 3624 DiskAttachmentReader._process_link(link, obj) 3625 3626 # Discard the end tag: 3627 reader.read() 3628 3629 return obj
3631 @staticmethod 3632 def read_many(reader): 3633 # Do nothing if there aren't more tags: 3634 objs = List() 3635 if not reader.forward(): 3636 return objs 3637 3638 # Process the attributes: 3639 objs.href = reader.get_attribute('href') 3640 3641 # Discard the start tag: 3642 empty = reader.empty_element() 3643 reader.read() 3644 if empty: 3645 return objs 3646 3647 # Process the inner elements: 3648 while reader.forward(): 3649 objs.append(DiskAttachmentReader.read_one(reader)) 3650 3651 # Discard the end tag: 3652 reader.read() 3653 3654 return objs
3657class DiskProfileReader(Reader): 3658 3659 def __init__(self): 3660 super(DiskProfileReader, self).__init__() 3661 3662 @staticmethod 3663 def read_one(reader): 3664 # Do nothing if there aren't more tags: 3665 if not reader.forward(): 3666 return None 3667 3668 # Create the object: 3669 obj = types.DiskProfile() 3670 3671 # Process the attributes: 3672 obj.href = reader.get_attribute('href') 3673 value = reader.get_attribute('id') 3674 if value is not None: 3675 obj.id = value 3676 3677 # Discard the start tag: 3678 empty = reader.empty_element() 3679 reader.read() 3680 if empty: 3681 return obj 3682 3683 # Process the inner elements: 3684 links = [] 3685 while reader.forward(): 3686 tag = reader.node_name() 3687 if tag == 'comment': 3688 obj.comment = Reader.read_string(reader) 3689 elif tag == 'description': 3690 obj.description = Reader.read_string(reader) 3691 elif tag == 'name': 3692 obj.name = Reader.read_string(reader) 3693 elif tag == 'permissions': 3694 obj.permissions = PermissionReader.read_many(reader) 3695 elif tag == 'qos': 3696 obj.qos = QosReader.read_one(reader) 3697 elif tag == 'storage_domain': 3698 obj.storage_domain = StorageDomainReader.read_one(reader) 3699 elif tag == 'link': 3700 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3701 reader.next_element() 3702 else: 3703 reader.next_element() 3704 for link in links: 3705 DiskProfileReader._process_link(link, obj) 3706 3707 # Discard the end tag: 3708 reader.read() 3709 3710 return obj 3711 3712 @staticmethod 3713 def read_many(reader): 3714 # Do nothing if there aren't more tags: 3715 objs = List() 3716 if not reader.forward(): 3717 return objs 3718 3719 # Process the attributes: 3720 objs.href = reader.get_attribute('href') 3721 3722 # Discard the start tag: 3723 empty = reader.empty_element() 3724 reader.read() 3725 if empty: 3726 return objs 3727 3728 # Process the inner elements: 3729 while reader.forward(): 3730 objs.append(DiskProfileReader.read_one(reader)) 3731 3732 # Discard the end tag: 3733 reader.read() 3734 3735 return objs 3736 3737 @staticmethod 3738 def _process_link(link, obj): 3739 # Process the attributes: 3740 rel = link[0] 3741 href = link[1] 3742 if href and rel: 3743 if rel == "permissions": 3744 if obj.permissions is not None: 3745 obj.permissions.href = href 3746 else: 3747 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3662 @staticmethod 3663 def read_one(reader): 3664 # Do nothing if there aren't more tags: 3665 if not reader.forward(): 3666 return None 3667 3668 # Create the object: 3669 obj = types.DiskProfile() 3670 3671 # Process the attributes: 3672 obj.href = reader.get_attribute('href') 3673 value = reader.get_attribute('id') 3674 if value is not None: 3675 obj.id = value 3676 3677 # Discard the start tag: 3678 empty = reader.empty_element() 3679 reader.read() 3680 if empty: 3681 return obj 3682 3683 # Process the inner elements: 3684 links = [] 3685 while reader.forward(): 3686 tag = reader.node_name() 3687 if tag == 'comment': 3688 obj.comment = Reader.read_string(reader) 3689 elif tag == 'description': 3690 obj.description = Reader.read_string(reader) 3691 elif tag == 'name': 3692 obj.name = Reader.read_string(reader) 3693 elif tag == 'permissions': 3694 obj.permissions = PermissionReader.read_many(reader) 3695 elif tag == 'qos': 3696 obj.qos = QosReader.read_one(reader) 3697 elif tag == 'storage_domain': 3698 obj.storage_domain = StorageDomainReader.read_one(reader) 3699 elif tag == 'link': 3700 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3701 reader.next_element() 3702 else: 3703 reader.next_element() 3704 for link in links: 3705 DiskProfileReader._process_link(link, obj) 3706 3707 # Discard the end tag: 3708 reader.read() 3709 3710 return obj
3712 @staticmethod 3713 def read_many(reader): 3714 # Do nothing if there aren't more tags: 3715 objs = List() 3716 if not reader.forward(): 3717 return objs 3718 3719 # Process the attributes: 3720 objs.href = reader.get_attribute('href') 3721 3722 # Discard the start tag: 3723 empty = reader.empty_element() 3724 reader.read() 3725 if empty: 3726 return objs 3727 3728 # Process the inner elements: 3729 while reader.forward(): 3730 objs.append(DiskProfileReader.read_one(reader)) 3731 3732 # Discard the end tag: 3733 reader.read() 3734 3735 return objs
3750class DiskSnapshotReader(Reader): 3751 3752 def __init__(self): 3753 super(DiskSnapshotReader, self).__init__() 3754 3755 @staticmethod 3756 def read_one(reader): 3757 # Do nothing if there aren't more tags: 3758 if not reader.forward(): 3759 return None 3760 3761 # Create the object: 3762 obj = types.DiskSnapshot() 3763 3764 # Process the attributes: 3765 obj.href = reader.get_attribute('href') 3766 value = reader.get_attribute('id') 3767 if value is not None: 3768 obj.id = value 3769 3770 # Discard the start tag: 3771 empty = reader.empty_element() 3772 reader.read() 3773 if empty: 3774 return obj 3775 3776 # Process the inner elements: 3777 links = [] 3778 while reader.forward(): 3779 tag = reader.node_name() 3780 if tag == 'active': 3781 obj.active = Reader.read_boolean(reader) 3782 elif tag == 'actual_size': 3783 obj.actual_size = Reader.read_integer(reader) 3784 elif tag == 'alias': 3785 obj.alias = Reader.read_string(reader) 3786 elif tag == 'backup': 3787 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3788 elif tag == 'backup_mode': 3789 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3790 elif tag == 'bootable': 3791 obj.bootable = Reader.read_boolean(reader) 3792 elif tag == 'comment': 3793 obj.comment = Reader.read_string(reader) 3794 elif tag == 'content_type': 3795 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3796 elif tag == 'description': 3797 obj.description = Reader.read_string(reader) 3798 elif tag == 'disk': 3799 obj.disk = DiskReader.read_one(reader) 3800 elif tag == 'disk_profile': 3801 obj.disk_profile = DiskProfileReader.read_one(reader) 3802 elif tag == 'disk_snapshots': 3803 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3804 elif tag == 'external_disk': 3805 obj.external_disk = Reader.read_string(reader) 3806 elif tag == 'format': 3807 obj.format = Reader.read_enum(types.DiskFormat, reader) 3808 elif tag == 'image_id': 3809 obj.image_id = Reader.read_string(reader) 3810 elif tag == 'initial_size': 3811 obj.initial_size = Reader.read_integer(reader) 3812 elif tag == 'instance_type': 3813 obj.instance_type = InstanceTypeReader.read_one(reader) 3814 elif tag == 'interface': 3815 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3816 elif tag == 'logical_name': 3817 obj.logical_name = Reader.read_string(reader) 3818 elif tag == 'lun_storage': 3819 obj.lun_storage = HostStorageReader.read_one(reader) 3820 elif tag == 'name': 3821 obj.name = Reader.read_string(reader) 3822 elif tag == 'openstack_volume_type': 3823 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3824 elif tag == 'parent': 3825 obj.parent = DiskSnapshotReader.read_one(reader) 3826 elif tag == 'permissions': 3827 obj.permissions = PermissionReader.read_many(reader) 3828 elif tag == 'propagate_errors': 3829 obj.propagate_errors = Reader.read_boolean(reader) 3830 elif tag == 'provisioned_size': 3831 obj.provisioned_size = Reader.read_integer(reader) 3832 elif tag == 'qcow_version': 3833 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3834 elif tag == 'quota': 3835 obj.quota = QuotaReader.read_one(reader) 3836 elif tag == 'read_only': 3837 obj.read_only = Reader.read_boolean(reader) 3838 elif tag == 'sgio': 3839 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3840 elif tag == 'shareable': 3841 obj.shareable = Reader.read_boolean(reader) 3842 elif tag == 'snapshot': 3843 obj.snapshot = SnapshotReader.read_one(reader) 3844 elif tag == 'sparse': 3845 obj.sparse = Reader.read_boolean(reader) 3846 elif tag == 'statistics': 3847 obj.statistics = StatisticReader.read_many(reader) 3848 elif tag == 'status': 3849 obj.status = Reader.read_enum(types.DiskStatus, reader) 3850 elif tag == 'storage_domain': 3851 obj.storage_domain = StorageDomainReader.read_one(reader) 3852 elif tag == 'storage_domains': 3853 obj.storage_domains = StorageDomainReader.read_many(reader) 3854 elif tag == 'storage_type': 3855 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3856 elif tag == 'template': 3857 obj.template = TemplateReader.read_one(reader) 3858 elif tag == 'total_size': 3859 obj.total_size = Reader.read_integer(reader) 3860 elif tag == 'uses_scsi_reservation': 3861 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3862 elif tag == 'vm': 3863 obj.vm = VmReader.read_one(reader) 3864 elif tag == 'vms': 3865 obj.vms = VmReader.read_many(reader) 3866 elif tag == 'wipe_after_delete': 3867 obj.wipe_after_delete = Reader.read_boolean(reader) 3868 elif tag == 'link': 3869 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3870 reader.next_element() 3871 else: 3872 reader.next_element() 3873 for link in links: 3874 DiskSnapshotReader._process_link(link, obj) 3875 3876 # Discard the end tag: 3877 reader.read() 3878 3879 return obj 3880 3881 @staticmethod 3882 def read_many(reader): 3883 # Do nothing if there aren't more tags: 3884 objs = List() 3885 if not reader.forward(): 3886 return objs 3887 3888 # Process the attributes: 3889 objs.href = reader.get_attribute('href') 3890 3891 # Discard the start tag: 3892 empty = reader.empty_element() 3893 reader.read() 3894 if empty: 3895 return objs 3896 3897 # Process the inner elements: 3898 while reader.forward(): 3899 objs.append(DiskSnapshotReader.read_one(reader)) 3900 3901 # Discard the end tag: 3902 reader.read() 3903 3904 return objs 3905 3906 @staticmethod 3907 def _process_link(link, obj): 3908 # Process the attributes: 3909 rel = link[0] 3910 href = link[1] 3911 if href and rel: 3912 if rel == "disksnapshots": 3913 if obj.disk_snapshots is not None: 3914 obj.disk_snapshots.href = href 3915 else: 3916 obj.disk_snapshots = List(href) 3917 elif rel == "permissions": 3918 if obj.permissions is not None: 3919 obj.permissions.href = href 3920 else: 3921 obj.permissions = List(href) 3922 elif rel == "statistics": 3923 if obj.statistics is not None: 3924 obj.statistics.href = href 3925 else: 3926 obj.statistics = List(href) 3927 elif rel == "storagedomains": 3928 if obj.storage_domains is not None: 3929 obj.storage_domains.href = href 3930 else: 3931 obj.storage_domains = List(href) 3932 elif rel == "vms": 3933 if obj.vms is not None: 3934 obj.vms.href = href 3935 else: 3936 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3755 @staticmethod 3756 def read_one(reader): 3757 # Do nothing if there aren't more tags: 3758 if not reader.forward(): 3759 return None 3760 3761 # Create the object: 3762 obj = types.DiskSnapshot() 3763 3764 # Process the attributes: 3765 obj.href = reader.get_attribute('href') 3766 value = reader.get_attribute('id') 3767 if value is not None: 3768 obj.id = value 3769 3770 # Discard the start tag: 3771 empty = reader.empty_element() 3772 reader.read() 3773 if empty: 3774 return obj 3775 3776 # Process the inner elements: 3777 links = [] 3778 while reader.forward(): 3779 tag = reader.node_name() 3780 if tag == 'active': 3781 obj.active = Reader.read_boolean(reader) 3782 elif tag == 'actual_size': 3783 obj.actual_size = Reader.read_integer(reader) 3784 elif tag == 'alias': 3785 obj.alias = Reader.read_string(reader) 3786 elif tag == 'backup': 3787 obj.backup = Reader.read_enum(types.DiskBackup, reader) 3788 elif tag == 'backup_mode': 3789 obj.backup_mode = Reader.read_enum(types.DiskBackupMode, reader) 3790 elif tag == 'bootable': 3791 obj.bootable = Reader.read_boolean(reader) 3792 elif tag == 'comment': 3793 obj.comment = Reader.read_string(reader) 3794 elif tag == 'content_type': 3795 obj.content_type = Reader.read_enum(types.DiskContentType, reader) 3796 elif tag == 'description': 3797 obj.description = Reader.read_string(reader) 3798 elif tag == 'disk': 3799 obj.disk = DiskReader.read_one(reader) 3800 elif tag == 'disk_profile': 3801 obj.disk_profile = DiskProfileReader.read_one(reader) 3802 elif tag == 'disk_snapshots': 3803 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 3804 elif tag == 'external_disk': 3805 obj.external_disk = Reader.read_string(reader) 3806 elif tag == 'format': 3807 obj.format = Reader.read_enum(types.DiskFormat, reader) 3808 elif tag == 'image_id': 3809 obj.image_id = Reader.read_string(reader) 3810 elif tag == 'initial_size': 3811 obj.initial_size = Reader.read_integer(reader) 3812 elif tag == 'instance_type': 3813 obj.instance_type = InstanceTypeReader.read_one(reader) 3814 elif tag == 'interface': 3815 obj.interface = Reader.read_enum(types.DiskInterface, reader) 3816 elif tag == 'logical_name': 3817 obj.logical_name = Reader.read_string(reader) 3818 elif tag == 'lun_storage': 3819 obj.lun_storage = HostStorageReader.read_one(reader) 3820 elif tag == 'name': 3821 obj.name = Reader.read_string(reader) 3822 elif tag == 'openstack_volume_type': 3823 obj.openstack_volume_type = OpenStackVolumeTypeReader.read_one(reader) 3824 elif tag == 'parent': 3825 obj.parent = DiskSnapshotReader.read_one(reader) 3826 elif tag == 'permissions': 3827 obj.permissions = PermissionReader.read_many(reader) 3828 elif tag == 'propagate_errors': 3829 obj.propagate_errors = Reader.read_boolean(reader) 3830 elif tag == 'provisioned_size': 3831 obj.provisioned_size = Reader.read_integer(reader) 3832 elif tag == 'qcow_version': 3833 obj.qcow_version = Reader.read_enum(types.QcowVersion, reader) 3834 elif tag == 'quota': 3835 obj.quota = QuotaReader.read_one(reader) 3836 elif tag == 'read_only': 3837 obj.read_only = Reader.read_boolean(reader) 3838 elif tag == 'sgio': 3839 obj.sgio = Reader.read_enum(types.ScsiGenericIO, reader) 3840 elif tag == 'shareable': 3841 obj.shareable = Reader.read_boolean(reader) 3842 elif tag == 'snapshot': 3843 obj.snapshot = SnapshotReader.read_one(reader) 3844 elif tag == 'sparse': 3845 obj.sparse = Reader.read_boolean(reader) 3846 elif tag == 'statistics': 3847 obj.statistics = StatisticReader.read_many(reader) 3848 elif tag == 'status': 3849 obj.status = Reader.read_enum(types.DiskStatus, reader) 3850 elif tag == 'storage_domain': 3851 obj.storage_domain = StorageDomainReader.read_one(reader) 3852 elif tag == 'storage_domains': 3853 obj.storage_domains = StorageDomainReader.read_many(reader) 3854 elif tag == 'storage_type': 3855 obj.storage_type = Reader.read_enum(types.DiskStorageType, reader) 3856 elif tag == 'template': 3857 obj.template = TemplateReader.read_one(reader) 3858 elif tag == 'total_size': 3859 obj.total_size = Reader.read_integer(reader) 3860 elif tag == 'uses_scsi_reservation': 3861 obj.uses_scsi_reservation = Reader.read_boolean(reader) 3862 elif tag == 'vm': 3863 obj.vm = VmReader.read_one(reader) 3864 elif tag == 'vms': 3865 obj.vms = VmReader.read_many(reader) 3866 elif tag == 'wipe_after_delete': 3867 obj.wipe_after_delete = Reader.read_boolean(reader) 3868 elif tag == 'link': 3869 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 3870 reader.next_element() 3871 else: 3872 reader.next_element() 3873 for link in links: 3874 DiskSnapshotReader._process_link(link, obj) 3875 3876 # Discard the end tag: 3877 reader.read() 3878 3879 return obj
3881 @staticmethod 3882 def read_many(reader): 3883 # Do nothing if there aren't more tags: 3884 objs = List() 3885 if not reader.forward(): 3886 return objs 3887 3888 # Process the attributes: 3889 objs.href = reader.get_attribute('href') 3890 3891 # Discard the start tag: 3892 empty = reader.empty_element() 3893 reader.read() 3894 if empty: 3895 return objs 3896 3897 # Process the inner elements: 3898 while reader.forward(): 3899 objs.append(DiskSnapshotReader.read_one(reader)) 3900 3901 # Discard the end tag: 3902 reader.read() 3903 3904 return objs
3939class DisplayReader(Reader): 3940 3941 def __init__(self): 3942 super(DisplayReader, self).__init__() 3943 3944 @staticmethod 3945 def read_one(reader): 3946 # Do nothing if there aren't more tags: 3947 if not reader.forward(): 3948 return None 3949 3950 # Create the object: 3951 obj = types.Display() 3952 3953 # Process the attributes: 3954 obj.href = reader.get_attribute('href') 3955 3956 # Discard the start tag: 3957 empty = reader.empty_element() 3958 reader.read() 3959 if empty: 3960 return obj 3961 3962 # Process the inner elements: 3963 links = [] 3964 while reader.forward(): 3965 tag = reader.node_name() 3966 if tag == 'address': 3967 obj.address = Reader.read_string(reader) 3968 elif tag == 'allow_override': 3969 obj.allow_override = Reader.read_boolean(reader) 3970 elif tag == 'certificate': 3971 obj.certificate = CertificateReader.read_one(reader) 3972 elif tag == 'copy_paste_enabled': 3973 obj.copy_paste_enabled = Reader.read_boolean(reader) 3974 elif tag == 'disconnect_action': 3975 obj.disconnect_action = Reader.read_string(reader) 3976 elif tag == 'disconnect_action_delay': 3977 obj.disconnect_action_delay = Reader.read_integer(reader) 3978 elif tag == 'file_transfer_enabled': 3979 obj.file_transfer_enabled = Reader.read_boolean(reader) 3980 elif tag == 'keyboard_layout': 3981 obj.keyboard_layout = Reader.read_string(reader) 3982 elif tag == 'monitors': 3983 obj.monitors = Reader.read_integer(reader) 3984 elif tag == 'port': 3985 obj.port = Reader.read_integer(reader) 3986 elif tag == 'proxy': 3987 obj.proxy = Reader.read_string(reader) 3988 elif tag == 'secure_port': 3989 obj.secure_port = Reader.read_integer(reader) 3990 elif tag == 'single_qxl_pci': 3991 obj.single_qxl_pci = Reader.read_boolean(reader) 3992 elif tag == 'smartcard_enabled': 3993 obj.smartcard_enabled = Reader.read_boolean(reader) 3994 elif tag == 'type': 3995 obj.type = Reader.read_enum(types.DisplayType, reader) 3996 else: 3997 reader.next_element() 3998 for link in links: 3999 DisplayReader._process_link(link, obj) 4000 4001 # Discard the end tag: 4002 reader.read() 4003 4004 return obj 4005 4006 @staticmethod 4007 def read_many(reader): 4008 # Do nothing if there aren't more tags: 4009 objs = List() 4010 if not reader.forward(): 4011 return objs 4012 4013 # Process the attributes: 4014 objs.href = reader.get_attribute('href') 4015 4016 # Discard the start tag: 4017 empty = reader.empty_element() 4018 reader.read() 4019 if empty: 4020 return objs 4021 4022 # Process the inner elements: 4023 while reader.forward(): 4024 objs.append(DisplayReader.read_one(reader)) 4025 4026 # Discard the end tag: 4027 reader.read() 4028 4029 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
3944 @staticmethod 3945 def read_one(reader): 3946 # Do nothing if there aren't more tags: 3947 if not reader.forward(): 3948 return None 3949 3950 # Create the object: 3951 obj = types.Display() 3952 3953 # Process the attributes: 3954 obj.href = reader.get_attribute('href') 3955 3956 # Discard the start tag: 3957 empty = reader.empty_element() 3958 reader.read() 3959 if empty: 3960 return obj 3961 3962 # Process the inner elements: 3963 links = [] 3964 while reader.forward(): 3965 tag = reader.node_name() 3966 if tag == 'address': 3967 obj.address = Reader.read_string(reader) 3968 elif tag == 'allow_override': 3969 obj.allow_override = Reader.read_boolean(reader) 3970 elif tag == 'certificate': 3971 obj.certificate = CertificateReader.read_one(reader) 3972 elif tag == 'copy_paste_enabled': 3973 obj.copy_paste_enabled = Reader.read_boolean(reader) 3974 elif tag == 'disconnect_action': 3975 obj.disconnect_action = Reader.read_string(reader) 3976 elif tag == 'disconnect_action_delay': 3977 obj.disconnect_action_delay = Reader.read_integer(reader) 3978 elif tag == 'file_transfer_enabled': 3979 obj.file_transfer_enabled = Reader.read_boolean(reader) 3980 elif tag == 'keyboard_layout': 3981 obj.keyboard_layout = Reader.read_string(reader) 3982 elif tag == 'monitors': 3983 obj.monitors = Reader.read_integer(reader) 3984 elif tag == 'port': 3985 obj.port = Reader.read_integer(reader) 3986 elif tag == 'proxy': 3987 obj.proxy = Reader.read_string(reader) 3988 elif tag == 'secure_port': 3989 obj.secure_port = Reader.read_integer(reader) 3990 elif tag == 'single_qxl_pci': 3991 obj.single_qxl_pci = Reader.read_boolean(reader) 3992 elif tag == 'smartcard_enabled': 3993 obj.smartcard_enabled = Reader.read_boolean(reader) 3994 elif tag == 'type': 3995 obj.type = Reader.read_enum(types.DisplayType, reader) 3996 else: 3997 reader.next_element() 3998 for link in links: 3999 DisplayReader._process_link(link, obj) 4000 4001 # Discard the end tag: 4002 reader.read() 4003 4004 return obj
4006 @staticmethod 4007 def read_many(reader): 4008 # Do nothing if there aren't more tags: 4009 objs = List() 4010 if not reader.forward(): 4011 return objs 4012 4013 # Process the attributes: 4014 objs.href = reader.get_attribute('href') 4015 4016 # Discard the start tag: 4017 empty = reader.empty_element() 4018 reader.read() 4019 if empty: 4020 return objs 4021 4022 # Process the inner elements: 4023 while reader.forward(): 4024 objs.append(DisplayReader.read_one(reader)) 4025 4026 # Discard the end tag: 4027 reader.read() 4028 4029 return objs
4032class DnsReader(Reader): 4033 4034 def __init__(self): 4035 super(DnsReader, self).__init__() 4036 4037 @staticmethod 4038 def read_one(reader): 4039 # Do nothing if there aren't more tags: 4040 if not reader.forward(): 4041 return None 4042 4043 # Create the object: 4044 obj = types.Dns() 4045 4046 # Process the attributes: 4047 obj.href = reader.get_attribute('href') 4048 4049 # Discard the start tag: 4050 empty = reader.empty_element() 4051 reader.read() 4052 if empty: 4053 return obj 4054 4055 # Process the inner elements: 4056 links = [] 4057 while reader.forward(): 4058 tag = reader.node_name() 4059 if tag == 'search_domains': 4060 obj.search_domains = HostReader.read_many(reader) 4061 elif tag == 'servers': 4062 obj.servers = HostReader.read_many(reader) 4063 else: 4064 reader.next_element() 4065 for link in links: 4066 DnsReader._process_link(link, obj) 4067 4068 # Discard the end tag: 4069 reader.read() 4070 4071 return obj 4072 4073 @staticmethod 4074 def read_many(reader): 4075 # Do nothing if there aren't more tags: 4076 objs = List() 4077 if not reader.forward(): 4078 return objs 4079 4080 # Process the attributes: 4081 objs.href = reader.get_attribute('href') 4082 4083 # Discard the start tag: 4084 empty = reader.empty_element() 4085 reader.read() 4086 if empty: 4087 return objs 4088 4089 # Process the inner elements: 4090 while reader.forward(): 4091 objs.append(DnsReader.read_one(reader)) 4092 4093 # Discard the end tag: 4094 reader.read() 4095 4096 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4037 @staticmethod 4038 def read_one(reader): 4039 # Do nothing if there aren't more tags: 4040 if not reader.forward(): 4041 return None 4042 4043 # Create the object: 4044 obj = types.Dns() 4045 4046 # Process the attributes: 4047 obj.href = reader.get_attribute('href') 4048 4049 # Discard the start tag: 4050 empty = reader.empty_element() 4051 reader.read() 4052 if empty: 4053 return obj 4054 4055 # Process the inner elements: 4056 links = [] 4057 while reader.forward(): 4058 tag = reader.node_name() 4059 if tag == 'search_domains': 4060 obj.search_domains = HostReader.read_many(reader) 4061 elif tag == 'servers': 4062 obj.servers = HostReader.read_many(reader) 4063 else: 4064 reader.next_element() 4065 for link in links: 4066 DnsReader._process_link(link, obj) 4067 4068 # Discard the end tag: 4069 reader.read() 4070 4071 return obj
4073 @staticmethod 4074 def read_many(reader): 4075 # Do nothing if there aren't more tags: 4076 objs = List() 4077 if not reader.forward(): 4078 return objs 4079 4080 # Process the attributes: 4081 objs.href = reader.get_attribute('href') 4082 4083 # Discard the start tag: 4084 empty = reader.empty_element() 4085 reader.read() 4086 if empty: 4087 return objs 4088 4089 # Process the inner elements: 4090 while reader.forward(): 4091 objs.append(DnsReader.read_one(reader)) 4092 4093 # Discard the end tag: 4094 reader.read() 4095 4096 return objs
4099class DnsResolverConfigurationReader(Reader): 4100 4101 def __init__(self): 4102 super(DnsResolverConfigurationReader, self).__init__() 4103 4104 @staticmethod 4105 def read_one(reader): 4106 # Do nothing if there aren't more tags: 4107 if not reader.forward(): 4108 return None 4109 4110 # Create the object: 4111 obj = types.DnsResolverConfiguration() 4112 4113 # Process the attributes: 4114 obj.href = reader.get_attribute('href') 4115 4116 # Discard the start tag: 4117 empty = reader.empty_element() 4118 reader.read() 4119 if empty: 4120 return obj 4121 4122 # Process the inner elements: 4123 links = [] 4124 while reader.forward(): 4125 tag = reader.node_name() 4126 if tag == 'name_servers': 4127 obj.name_servers = Reader.read_strings(reader) 4128 else: 4129 reader.next_element() 4130 for link in links: 4131 DnsResolverConfigurationReader._process_link(link, obj) 4132 4133 # Discard the end tag: 4134 reader.read() 4135 4136 return obj 4137 4138 @staticmethod 4139 def read_many(reader): 4140 # Do nothing if there aren't more tags: 4141 objs = List() 4142 if not reader.forward(): 4143 return objs 4144 4145 # Process the attributes: 4146 objs.href = reader.get_attribute('href') 4147 4148 # Discard the start tag: 4149 empty = reader.empty_element() 4150 reader.read() 4151 if empty: 4152 return objs 4153 4154 # Process the inner elements: 4155 while reader.forward(): 4156 objs.append(DnsResolverConfigurationReader.read_one(reader)) 4157 4158 # Discard the end tag: 4159 reader.read() 4160 4161 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4104 @staticmethod 4105 def read_one(reader): 4106 # Do nothing if there aren't more tags: 4107 if not reader.forward(): 4108 return None 4109 4110 # Create the object: 4111 obj = types.DnsResolverConfiguration() 4112 4113 # Process the attributes: 4114 obj.href = reader.get_attribute('href') 4115 4116 # Discard the start tag: 4117 empty = reader.empty_element() 4118 reader.read() 4119 if empty: 4120 return obj 4121 4122 # Process the inner elements: 4123 links = [] 4124 while reader.forward(): 4125 tag = reader.node_name() 4126 if tag == 'name_servers': 4127 obj.name_servers = Reader.read_strings(reader) 4128 else: 4129 reader.next_element() 4130 for link in links: 4131 DnsResolverConfigurationReader._process_link(link, obj) 4132 4133 # Discard the end tag: 4134 reader.read() 4135 4136 return obj
4138 @staticmethod 4139 def read_many(reader): 4140 # Do nothing if there aren't more tags: 4141 objs = List() 4142 if not reader.forward(): 4143 return objs 4144 4145 # Process the attributes: 4146 objs.href = reader.get_attribute('href') 4147 4148 # Discard the start tag: 4149 empty = reader.empty_element() 4150 reader.read() 4151 if empty: 4152 return objs 4153 4154 # Process the inner elements: 4155 while reader.forward(): 4156 objs.append(DnsResolverConfigurationReader.read_one(reader)) 4157 4158 # Discard the end tag: 4159 reader.read() 4160 4161 return objs
4164class DomainReader(Reader): 4165 4166 def __init__(self): 4167 super(DomainReader, self).__init__() 4168 4169 @staticmethod 4170 def read_one(reader): 4171 # Do nothing if there aren't more tags: 4172 if not reader.forward(): 4173 return None 4174 4175 # Create the object: 4176 obj = types.Domain() 4177 4178 # Process the attributes: 4179 obj.href = reader.get_attribute('href') 4180 value = reader.get_attribute('id') 4181 if value is not None: 4182 obj.id = value 4183 4184 # Discard the start tag: 4185 empty = reader.empty_element() 4186 reader.read() 4187 if empty: 4188 return obj 4189 4190 # Process the inner elements: 4191 links = [] 4192 while reader.forward(): 4193 tag = reader.node_name() 4194 if tag == 'comment': 4195 obj.comment = Reader.read_string(reader) 4196 elif tag == 'description': 4197 obj.description = Reader.read_string(reader) 4198 elif tag == 'groups': 4199 obj.groups = GroupReader.read_many(reader) 4200 elif tag == 'name': 4201 obj.name = Reader.read_string(reader) 4202 elif tag == 'user': 4203 obj.user = UserReader.read_one(reader) 4204 elif tag == 'users': 4205 obj.users = UserReader.read_many(reader) 4206 elif tag == 'link': 4207 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 4208 reader.next_element() 4209 else: 4210 reader.next_element() 4211 for link in links: 4212 DomainReader._process_link(link, obj) 4213 4214 # Discard the end tag: 4215 reader.read() 4216 4217 return obj 4218 4219 @staticmethod 4220 def read_many(reader): 4221 # Do nothing if there aren't more tags: 4222 objs = List() 4223 if not reader.forward(): 4224 return objs 4225 4226 # Process the attributes: 4227 objs.href = reader.get_attribute('href') 4228 4229 # Discard the start tag: 4230 empty = reader.empty_element() 4231 reader.read() 4232 if empty: 4233 return objs 4234 4235 # Process the inner elements: 4236 while reader.forward(): 4237 objs.append(DomainReader.read_one(reader)) 4238 4239 # Discard the end tag: 4240 reader.read() 4241 4242 return objs 4243 4244 @staticmethod 4245 def _process_link(link, obj): 4246 # Process the attributes: 4247 rel = link[0] 4248 href = link[1] 4249 if href and rel: 4250 if rel == "groups": 4251 if obj.groups is not None: 4252 obj.groups.href = href 4253 else: 4254 obj.groups = List(href) 4255 elif rel == "users": 4256 if obj.users is not None: 4257 obj.users.href = href 4258 else: 4259 obj.users = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4169 @staticmethod 4170 def read_one(reader): 4171 # Do nothing if there aren't more tags: 4172 if not reader.forward(): 4173 return None 4174 4175 # Create the object: 4176 obj = types.Domain() 4177 4178 # Process the attributes: 4179 obj.href = reader.get_attribute('href') 4180 value = reader.get_attribute('id') 4181 if value is not None: 4182 obj.id = value 4183 4184 # Discard the start tag: 4185 empty = reader.empty_element() 4186 reader.read() 4187 if empty: 4188 return obj 4189 4190 # Process the inner elements: 4191 links = [] 4192 while reader.forward(): 4193 tag = reader.node_name() 4194 if tag == 'comment': 4195 obj.comment = Reader.read_string(reader) 4196 elif tag == 'description': 4197 obj.description = Reader.read_string(reader) 4198 elif tag == 'groups': 4199 obj.groups = GroupReader.read_many(reader) 4200 elif tag == 'name': 4201 obj.name = Reader.read_string(reader) 4202 elif tag == 'user': 4203 obj.user = UserReader.read_one(reader) 4204 elif tag == 'users': 4205 obj.users = UserReader.read_many(reader) 4206 elif tag == 'link': 4207 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 4208 reader.next_element() 4209 else: 4210 reader.next_element() 4211 for link in links: 4212 DomainReader._process_link(link, obj) 4213 4214 # Discard the end tag: 4215 reader.read() 4216 4217 return obj
4219 @staticmethod 4220 def read_many(reader): 4221 # Do nothing if there aren't more tags: 4222 objs = List() 4223 if not reader.forward(): 4224 return objs 4225 4226 # Process the attributes: 4227 objs.href = reader.get_attribute('href') 4228 4229 # Discard the start tag: 4230 empty = reader.empty_element() 4231 reader.read() 4232 if empty: 4233 return objs 4234 4235 # Process the inner elements: 4236 while reader.forward(): 4237 objs.append(DomainReader.read_one(reader)) 4238 4239 # Discard the end tag: 4240 reader.read() 4241 4242 return objs
4262class DynamicCpuReader(Reader): 4263 4264 def __init__(self): 4265 super(DynamicCpuReader, self).__init__() 4266 4267 @staticmethod 4268 def read_one(reader): 4269 # Do nothing if there aren't more tags: 4270 if not reader.forward(): 4271 return None 4272 4273 # Create the object: 4274 obj = types.DynamicCpu() 4275 4276 # Process the attributes: 4277 obj.href = reader.get_attribute('href') 4278 4279 # Discard the start tag: 4280 empty = reader.empty_element() 4281 reader.read() 4282 if empty: 4283 return obj 4284 4285 # Process the inner elements: 4286 links = [] 4287 while reader.forward(): 4288 tag = reader.node_name() 4289 if tag == 'cpu_tune': 4290 obj.cpu_tune = CpuTuneReader.read_one(reader) 4291 elif tag == 'topology': 4292 obj.topology = CpuTopologyReader.read_one(reader) 4293 else: 4294 reader.next_element() 4295 for link in links: 4296 DynamicCpuReader._process_link(link, obj) 4297 4298 # Discard the end tag: 4299 reader.read() 4300 4301 return obj 4302 4303 @staticmethod 4304 def read_many(reader): 4305 # Do nothing if there aren't more tags: 4306 objs = List() 4307 if not reader.forward(): 4308 return objs 4309 4310 # Process the attributes: 4311 objs.href = reader.get_attribute('href') 4312 4313 # Discard the start tag: 4314 empty = reader.empty_element() 4315 reader.read() 4316 if empty: 4317 return objs 4318 4319 # Process the inner elements: 4320 while reader.forward(): 4321 objs.append(DynamicCpuReader.read_one(reader)) 4322 4323 # Discard the end tag: 4324 reader.read() 4325 4326 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4267 @staticmethod 4268 def read_one(reader): 4269 # Do nothing if there aren't more tags: 4270 if not reader.forward(): 4271 return None 4272 4273 # Create the object: 4274 obj = types.DynamicCpu() 4275 4276 # Process the attributes: 4277 obj.href = reader.get_attribute('href') 4278 4279 # Discard the start tag: 4280 empty = reader.empty_element() 4281 reader.read() 4282 if empty: 4283 return obj 4284 4285 # Process the inner elements: 4286 links = [] 4287 while reader.forward(): 4288 tag = reader.node_name() 4289 if tag == 'cpu_tune': 4290 obj.cpu_tune = CpuTuneReader.read_one(reader) 4291 elif tag == 'topology': 4292 obj.topology = CpuTopologyReader.read_one(reader) 4293 else: 4294 reader.next_element() 4295 for link in links: 4296 DynamicCpuReader._process_link(link, obj) 4297 4298 # Discard the end tag: 4299 reader.read() 4300 4301 return obj
4303 @staticmethod 4304 def read_many(reader): 4305 # Do nothing if there aren't more tags: 4306 objs = List() 4307 if not reader.forward(): 4308 return objs 4309 4310 # Process the attributes: 4311 objs.href = reader.get_attribute('href') 4312 4313 # Discard the start tag: 4314 empty = reader.empty_element() 4315 reader.read() 4316 if empty: 4317 return objs 4318 4319 # Process the inner elements: 4320 while reader.forward(): 4321 objs.append(DynamicCpuReader.read_one(reader)) 4322 4323 # Discard the end tag: 4324 reader.read() 4325 4326 return objs
4329class EntityProfileDetailReader(Reader): 4330 4331 def __init__(self): 4332 super(EntityProfileDetailReader, self).__init__() 4333 4334 @staticmethod 4335 def read_one(reader): 4336 # Do nothing if there aren't more tags: 4337 if not reader.forward(): 4338 return None 4339 4340 # Create the object: 4341 obj = types.EntityProfileDetail() 4342 4343 # Process the attributes: 4344 obj.href = reader.get_attribute('href') 4345 4346 # Discard the start tag: 4347 empty = reader.empty_element() 4348 reader.read() 4349 if empty: 4350 return obj 4351 4352 # Process the inner elements: 4353 links = [] 4354 while reader.forward(): 4355 tag = reader.node_name() 4356 if tag == 'profile_details': 4357 obj.profile_details = ProfileDetailReader.read_many(reader) 4358 else: 4359 reader.next_element() 4360 for link in links: 4361 EntityProfileDetailReader._process_link(link, obj) 4362 4363 # Discard the end tag: 4364 reader.read() 4365 4366 return obj 4367 4368 @staticmethod 4369 def read_many(reader): 4370 # Do nothing if there aren't more tags: 4371 objs = List() 4372 if not reader.forward(): 4373 return objs 4374 4375 # Process the attributes: 4376 objs.href = reader.get_attribute('href') 4377 4378 # Discard the start tag: 4379 empty = reader.empty_element() 4380 reader.read() 4381 if empty: 4382 return objs 4383 4384 # Process the inner elements: 4385 while reader.forward(): 4386 objs.append(EntityProfileDetailReader.read_one(reader)) 4387 4388 # Discard the end tag: 4389 reader.read() 4390 4391 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4334 @staticmethod 4335 def read_one(reader): 4336 # Do nothing if there aren't more tags: 4337 if not reader.forward(): 4338 return None 4339 4340 # Create the object: 4341 obj = types.EntityProfileDetail() 4342 4343 # Process the attributes: 4344 obj.href = reader.get_attribute('href') 4345 4346 # Discard the start tag: 4347 empty = reader.empty_element() 4348 reader.read() 4349 if empty: 4350 return obj 4351 4352 # Process the inner elements: 4353 links = [] 4354 while reader.forward(): 4355 tag = reader.node_name() 4356 if tag == 'profile_details': 4357 obj.profile_details = ProfileDetailReader.read_many(reader) 4358 else: 4359 reader.next_element() 4360 for link in links: 4361 EntityProfileDetailReader._process_link(link, obj) 4362 4363 # Discard the end tag: 4364 reader.read() 4365 4366 return obj
4368 @staticmethod 4369 def read_many(reader): 4370 # Do nothing if there aren't more tags: 4371 objs = List() 4372 if not reader.forward(): 4373 return objs 4374 4375 # Process the attributes: 4376 objs.href = reader.get_attribute('href') 4377 4378 # Discard the start tag: 4379 empty = reader.empty_element() 4380 reader.read() 4381 if empty: 4382 return objs 4383 4384 # Process the inner elements: 4385 while reader.forward(): 4386 objs.append(EntityProfileDetailReader.read_one(reader)) 4387 4388 # Discard the end tag: 4389 reader.read() 4390 4391 return objs
4394class ErrorHandlingReader(Reader): 4395 4396 def __init__(self): 4397 super(ErrorHandlingReader, self).__init__() 4398 4399 @staticmethod 4400 def read_one(reader): 4401 # Do nothing if there aren't more tags: 4402 if not reader.forward(): 4403 return None 4404 4405 # Create the object: 4406 obj = types.ErrorHandling() 4407 4408 # Process the attributes: 4409 obj.href = reader.get_attribute('href') 4410 4411 # Discard the start tag: 4412 empty = reader.empty_element() 4413 reader.read() 4414 if empty: 4415 return obj 4416 4417 # Process the inner elements: 4418 links = [] 4419 while reader.forward(): 4420 tag = reader.node_name() 4421 if tag == 'on_error': 4422 obj.on_error = Reader.read_enum(types.MigrateOnError, reader) 4423 else: 4424 reader.next_element() 4425 for link in links: 4426 ErrorHandlingReader._process_link(link, obj) 4427 4428 # Discard the end tag: 4429 reader.read() 4430 4431 return obj 4432 4433 @staticmethod 4434 def read_many(reader): 4435 # Do nothing if there aren't more tags: 4436 objs = List() 4437 if not reader.forward(): 4438 return objs 4439 4440 # Process the attributes: 4441 objs.href = reader.get_attribute('href') 4442 4443 # Discard the start tag: 4444 empty = reader.empty_element() 4445 reader.read() 4446 if empty: 4447 return objs 4448 4449 # Process the inner elements: 4450 while reader.forward(): 4451 objs.append(ErrorHandlingReader.read_one(reader)) 4452 4453 # Discard the end tag: 4454 reader.read() 4455 4456 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4399 @staticmethod 4400 def read_one(reader): 4401 # Do nothing if there aren't more tags: 4402 if not reader.forward(): 4403 return None 4404 4405 # Create the object: 4406 obj = types.ErrorHandling() 4407 4408 # Process the attributes: 4409 obj.href = reader.get_attribute('href') 4410 4411 # Discard the start tag: 4412 empty = reader.empty_element() 4413 reader.read() 4414 if empty: 4415 return obj 4416 4417 # Process the inner elements: 4418 links = [] 4419 while reader.forward(): 4420 tag = reader.node_name() 4421 if tag == 'on_error': 4422 obj.on_error = Reader.read_enum(types.MigrateOnError, reader) 4423 else: 4424 reader.next_element() 4425 for link in links: 4426 ErrorHandlingReader._process_link(link, obj) 4427 4428 # Discard the end tag: 4429 reader.read() 4430 4431 return obj
4433 @staticmethod 4434 def read_many(reader): 4435 # Do nothing if there aren't more tags: 4436 objs = List() 4437 if not reader.forward(): 4438 return objs 4439 4440 # Process the attributes: 4441 objs.href = reader.get_attribute('href') 4442 4443 # Discard the start tag: 4444 empty = reader.empty_element() 4445 reader.read() 4446 if empty: 4447 return objs 4448 4449 # Process the inner elements: 4450 while reader.forward(): 4451 objs.append(ErrorHandlingReader.read_one(reader)) 4452 4453 # Discard the end tag: 4454 reader.read() 4455 4456 return objs
4459class EventReader(Reader): 4460 4461 def __init__(self): 4462 super(EventReader, self).__init__() 4463 4464 @staticmethod 4465 def read_one(reader): 4466 # Do nothing if there aren't more tags: 4467 if not reader.forward(): 4468 return None 4469 4470 # Create the object: 4471 obj = types.Event() 4472 4473 # Process the attributes: 4474 obj.href = reader.get_attribute('href') 4475 value = reader.get_attribute('id') 4476 if value is not None: 4477 obj.id = value 4478 4479 # Discard the start tag: 4480 empty = reader.empty_element() 4481 reader.read() 4482 if empty: 4483 return obj 4484 4485 # Process the inner elements: 4486 links = [] 4487 while reader.forward(): 4488 tag = reader.node_name() 4489 if tag == 'cluster': 4490 obj.cluster = ClusterReader.read_one(reader) 4491 elif tag == 'code': 4492 obj.code = Reader.read_integer(reader) 4493 elif tag == 'comment': 4494 obj.comment = Reader.read_string(reader) 4495 elif tag == 'correlation_id': 4496 obj.correlation_id = Reader.read_string(reader) 4497 elif tag == 'custom_data': 4498 obj.custom_data = Reader.read_string(reader) 4499 elif tag == 'custom_id': 4500 obj.custom_id = Reader.read_integer(reader) 4501 elif tag == 'data_center': 4502 obj.data_center = DataCenterReader.read_one(reader) 4503 elif tag == 'description': 4504 obj.description = Reader.read_string(reader) 4505 elif tag == 'flood_rate': 4506 obj.flood_rate = Reader.read_integer(reader) 4507 elif tag == 'host': 4508 obj.host = HostReader.read_one(reader) 4509 elif tag == 'index': 4510 obj.index = Reader.read_integer(reader) 4511 elif tag == 'log_on_host': 4512 obj.log_on_host = Reader.read_boolean(reader) 4513 elif tag == 'name': 4514 obj.name = Reader.read_string(reader) 4515 elif tag == 'origin': 4516 obj.origin = Reader.read_string(reader) 4517 elif tag == 'severity': 4518 obj.severity = Reader.read_enum(types.LogSeverity, reader) 4519 elif tag == 'storage_domain': 4520 obj.storage_domain = StorageDomainReader.read_one(reader) 4521 elif tag == 'template': 4522 obj.template = TemplateReader.read_one(reader) 4523 elif tag == 'time': 4524 obj.time = Reader.read_date(reader) 4525 elif tag == 'user': 4526 obj.user = UserReader.read_one(reader) 4527 elif tag == 'vm': 4528 obj.vm = VmReader.read_one(reader) 4529 else: 4530 reader.next_element() 4531 for link in links: 4532 EventReader._process_link(link, obj) 4533 4534 # Discard the end tag: 4535 reader.read() 4536 4537 return obj 4538 4539 @staticmethod 4540 def read_many(reader): 4541 # Do nothing if there aren't more tags: 4542 objs = List() 4543 if not reader.forward(): 4544 return objs 4545 4546 # Process the attributes: 4547 objs.href = reader.get_attribute('href') 4548 4549 # Discard the start tag: 4550 empty = reader.empty_element() 4551 reader.read() 4552 if empty: 4553 return objs 4554 4555 # Process the inner elements: 4556 while reader.forward(): 4557 objs.append(EventReader.read_one(reader)) 4558 4559 # Discard the end tag: 4560 reader.read() 4561 4562 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4464 @staticmethod 4465 def read_one(reader): 4466 # Do nothing if there aren't more tags: 4467 if not reader.forward(): 4468 return None 4469 4470 # Create the object: 4471 obj = types.Event() 4472 4473 # Process the attributes: 4474 obj.href = reader.get_attribute('href') 4475 value = reader.get_attribute('id') 4476 if value is not None: 4477 obj.id = value 4478 4479 # Discard the start tag: 4480 empty = reader.empty_element() 4481 reader.read() 4482 if empty: 4483 return obj 4484 4485 # Process the inner elements: 4486 links = [] 4487 while reader.forward(): 4488 tag = reader.node_name() 4489 if tag == 'cluster': 4490 obj.cluster = ClusterReader.read_one(reader) 4491 elif tag == 'code': 4492 obj.code = Reader.read_integer(reader) 4493 elif tag == 'comment': 4494 obj.comment = Reader.read_string(reader) 4495 elif tag == 'correlation_id': 4496 obj.correlation_id = Reader.read_string(reader) 4497 elif tag == 'custom_data': 4498 obj.custom_data = Reader.read_string(reader) 4499 elif tag == 'custom_id': 4500 obj.custom_id = Reader.read_integer(reader) 4501 elif tag == 'data_center': 4502 obj.data_center = DataCenterReader.read_one(reader) 4503 elif tag == 'description': 4504 obj.description = Reader.read_string(reader) 4505 elif tag == 'flood_rate': 4506 obj.flood_rate = Reader.read_integer(reader) 4507 elif tag == 'host': 4508 obj.host = HostReader.read_one(reader) 4509 elif tag == 'index': 4510 obj.index = Reader.read_integer(reader) 4511 elif tag == 'log_on_host': 4512 obj.log_on_host = Reader.read_boolean(reader) 4513 elif tag == 'name': 4514 obj.name = Reader.read_string(reader) 4515 elif tag == 'origin': 4516 obj.origin = Reader.read_string(reader) 4517 elif tag == 'severity': 4518 obj.severity = Reader.read_enum(types.LogSeverity, reader) 4519 elif tag == 'storage_domain': 4520 obj.storage_domain = StorageDomainReader.read_one(reader) 4521 elif tag == 'template': 4522 obj.template = TemplateReader.read_one(reader) 4523 elif tag == 'time': 4524 obj.time = Reader.read_date(reader) 4525 elif tag == 'user': 4526 obj.user = UserReader.read_one(reader) 4527 elif tag == 'vm': 4528 obj.vm = VmReader.read_one(reader) 4529 else: 4530 reader.next_element() 4531 for link in links: 4532 EventReader._process_link(link, obj) 4533 4534 # Discard the end tag: 4535 reader.read() 4536 4537 return obj
4539 @staticmethod 4540 def read_many(reader): 4541 # Do nothing if there aren't more tags: 4542 objs = List() 4543 if not reader.forward(): 4544 return objs 4545 4546 # Process the attributes: 4547 objs.href = reader.get_attribute('href') 4548 4549 # Discard the start tag: 4550 empty = reader.empty_element() 4551 reader.read() 4552 if empty: 4553 return objs 4554 4555 # Process the inner elements: 4556 while reader.forward(): 4557 objs.append(EventReader.read_one(reader)) 4558 4559 # Discard the end tag: 4560 reader.read() 4561 4562 return objs
4565class EventSubscriptionReader(Reader): 4566 4567 def __init__(self): 4568 super(EventSubscriptionReader, self).__init__() 4569 4570 @staticmethod 4571 def read_one(reader): 4572 # Do nothing if there aren't more tags: 4573 if not reader.forward(): 4574 return None 4575 4576 # Create the object: 4577 obj = types.EventSubscription() 4578 4579 # Process the attributes: 4580 obj.href = reader.get_attribute('href') 4581 value = reader.get_attribute('id') 4582 if value is not None: 4583 obj.id = value 4584 4585 # Discard the start tag: 4586 empty = reader.empty_element() 4587 reader.read() 4588 if empty: 4589 return obj 4590 4591 # Process the inner elements: 4592 links = [] 4593 while reader.forward(): 4594 tag = reader.node_name() 4595 if tag == 'address': 4596 obj.address = Reader.read_string(reader) 4597 elif tag == 'comment': 4598 obj.comment = Reader.read_string(reader) 4599 elif tag == 'description': 4600 obj.description = Reader.read_string(reader) 4601 elif tag == 'event': 4602 obj.event = Reader.read_enum(types.NotifiableEvent, reader) 4603 elif tag == 'name': 4604 obj.name = Reader.read_string(reader) 4605 elif tag == 'notification_method': 4606 obj.notification_method = Reader.read_enum(types.NotificationMethod, reader) 4607 elif tag == 'user': 4608 obj.user = UserReader.read_one(reader) 4609 else: 4610 reader.next_element() 4611 for link in links: 4612 EventSubscriptionReader._process_link(link, obj) 4613 4614 # Discard the end tag: 4615 reader.read() 4616 4617 return obj 4618 4619 @staticmethod 4620 def read_many(reader): 4621 # Do nothing if there aren't more tags: 4622 objs = List() 4623 if not reader.forward(): 4624 return objs 4625 4626 # Process the attributes: 4627 objs.href = reader.get_attribute('href') 4628 4629 # Discard the start tag: 4630 empty = reader.empty_element() 4631 reader.read() 4632 if empty: 4633 return objs 4634 4635 # Process the inner elements: 4636 while reader.forward(): 4637 objs.append(EventSubscriptionReader.read_one(reader)) 4638 4639 # Discard the end tag: 4640 reader.read() 4641 4642 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4570 @staticmethod 4571 def read_one(reader): 4572 # Do nothing if there aren't more tags: 4573 if not reader.forward(): 4574 return None 4575 4576 # Create the object: 4577 obj = types.EventSubscription() 4578 4579 # Process the attributes: 4580 obj.href = reader.get_attribute('href') 4581 value = reader.get_attribute('id') 4582 if value is not None: 4583 obj.id = value 4584 4585 # Discard the start tag: 4586 empty = reader.empty_element() 4587 reader.read() 4588 if empty: 4589 return obj 4590 4591 # Process the inner elements: 4592 links = [] 4593 while reader.forward(): 4594 tag = reader.node_name() 4595 if tag == 'address': 4596 obj.address = Reader.read_string(reader) 4597 elif tag == 'comment': 4598 obj.comment = Reader.read_string(reader) 4599 elif tag == 'description': 4600 obj.description = Reader.read_string(reader) 4601 elif tag == 'event': 4602 obj.event = Reader.read_enum(types.NotifiableEvent, reader) 4603 elif tag == 'name': 4604 obj.name = Reader.read_string(reader) 4605 elif tag == 'notification_method': 4606 obj.notification_method = Reader.read_enum(types.NotificationMethod, reader) 4607 elif tag == 'user': 4608 obj.user = UserReader.read_one(reader) 4609 else: 4610 reader.next_element() 4611 for link in links: 4612 EventSubscriptionReader._process_link(link, obj) 4613 4614 # Discard the end tag: 4615 reader.read() 4616 4617 return obj
4619 @staticmethod 4620 def read_many(reader): 4621 # Do nothing if there aren't more tags: 4622 objs = List() 4623 if not reader.forward(): 4624 return objs 4625 4626 # Process the attributes: 4627 objs.href = reader.get_attribute('href') 4628 4629 # Discard the start tag: 4630 empty = reader.empty_element() 4631 reader.read() 4632 if empty: 4633 return objs 4634 4635 # Process the inner elements: 4636 while reader.forward(): 4637 objs.append(EventSubscriptionReader.read_one(reader)) 4638 4639 # Discard the end tag: 4640 reader.read() 4641 4642 return objs
4645class ExternalComputeResourceReader(Reader): 4646 4647 def __init__(self): 4648 super(ExternalComputeResourceReader, self).__init__() 4649 4650 @staticmethod 4651 def read_one(reader): 4652 # Do nothing if there aren't more tags: 4653 if not reader.forward(): 4654 return None 4655 4656 # Create the object: 4657 obj = types.ExternalComputeResource() 4658 4659 # Process the attributes: 4660 obj.href = reader.get_attribute('href') 4661 value = reader.get_attribute('id') 4662 if value is not None: 4663 obj.id = value 4664 4665 # Discard the start tag: 4666 empty = reader.empty_element() 4667 reader.read() 4668 if empty: 4669 return obj 4670 4671 # Process the inner elements: 4672 links = [] 4673 while reader.forward(): 4674 tag = reader.node_name() 4675 if tag == 'comment': 4676 obj.comment = Reader.read_string(reader) 4677 elif tag == 'description': 4678 obj.description = Reader.read_string(reader) 4679 elif tag == 'external_host_provider': 4680 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4681 elif tag == 'name': 4682 obj.name = Reader.read_string(reader) 4683 elif tag == 'provider': 4684 obj.provider = Reader.read_string(reader) 4685 elif tag == 'url': 4686 obj.url = Reader.read_string(reader) 4687 elif tag == 'user': 4688 obj.user = Reader.read_string(reader) 4689 else: 4690 reader.next_element() 4691 for link in links: 4692 ExternalComputeResourceReader._process_link(link, obj) 4693 4694 # Discard the end tag: 4695 reader.read() 4696 4697 return obj 4698 4699 @staticmethod 4700 def read_many(reader): 4701 # Do nothing if there aren't more tags: 4702 objs = List() 4703 if not reader.forward(): 4704 return objs 4705 4706 # Process the attributes: 4707 objs.href = reader.get_attribute('href') 4708 4709 # Discard the start tag: 4710 empty = reader.empty_element() 4711 reader.read() 4712 if empty: 4713 return objs 4714 4715 # Process the inner elements: 4716 while reader.forward(): 4717 objs.append(ExternalComputeResourceReader.read_one(reader)) 4718 4719 # Discard the end tag: 4720 reader.read() 4721 4722 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4650 @staticmethod 4651 def read_one(reader): 4652 # Do nothing if there aren't more tags: 4653 if not reader.forward(): 4654 return None 4655 4656 # Create the object: 4657 obj = types.ExternalComputeResource() 4658 4659 # Process the attributes: 4660 obj.href = reader.get_attribute('href') 4661 value = reader.get_attribute('id') 4662 if value is not None: 4663 obj.id = value 4664 4665 # Discard the start tag: 4666 empty = reader.empty_element() 4667 reader.read() 4668 if empty: 4669 return obj 4670 4671 # Process the inner elements: 4672 links = [] 4673 while reader.forward(): 4674 tag = reader.node_name() 4675 if tag == 'comment': 4676 obj.comment = Reader.read_string(reader) 4677 elif tag == 'description': 4678 obj.description = Reader.read_string(reader) 4679 elif tag == 'external_host_provider': 4680 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4681 elif tag == 'name': 4682 obj.name = Reader.read_string(reader) 4683 elif tag == 'provider': 4684 obj.provider = Reader.read_string(reader) 4685 elif tag == 'url': 4686 obj.url = Reader.read_string(reader) 4687 elif tag == 'user': 4688 obj.user = Reader.read_string(reader) 4689 else: 4690 reader.next_element() 4691 for link in links: 4692 ExternalComputeResourceReader._process_link(link, obj) 4693 4694 # Discard the end tag: 4695 reader.read() 4696 4697 return obj
4699 @staticmethod 4700 def read_many(reader): 4701 # Do nothing if there aren't more tags: 4702 objs = List() 4703 if not reader.forward(): 4704 return objs 4705 4706 # Process the attributes: 4707 objs.href = reader.get_attribute('href') 4708 4709 # Discard the start tag: 4710 empty = reader.empty_element() 4711 reader.read() 4712 if empty: 4713 return objs 4714 4715 # Process the inner elements: 4716 while reader.forward(): 4717 objs.append(ExternalComputeResourceReader.read_one(reader)) 4718 4719 # Discard the end tag: 4720 reader.read() 4721 4722 return objs
4725class ExternalDiscoveredHostReader(Reader): 4726 4727 def __init__(self): 4728 super(ExternalDiscoveredHostReader, self).__init__() 4729 4730 @staticmethod 4731 def read_one(reader): 4732 # Do nothing if there aren't more tags: 4733 if not reader.forward(): 4734 return None 4735 4736 # Create the object: 4737 obj = types.ExternalDiscoveredHost() 4738 4739 # Process the attributes: 4740 obj.href = reader.get_attribute('href') 4741 value = reader.get_attribute('id') 4742 if value is not None: 4743 obj.id = value 4744 4745 # Discard the start tag: 4746 empty = reader.empty_element() 4747 reader.read() 4748 if empty: 4749 return obj 4750 4751 # Process the inner elements: 4752 links = [] 4753 while reader.forward(): 4754 tag = reader.node_name() 4755 if tag == 'comment': 4756 obj.comment = Reader.read_string(reader) 4757 elif tag == 'description': 4758 obj.description = Reader.read_string(reader) 4759 elif tag == 'external_host_provider': 4760 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4761 elif tag == 'ip': 4762 obj.ip = Reader.read_string(reader) 4763 elif tag == 'last_report': 4764 obj.last_report = Reader.read_string(reader) 4765 elif tag == 'mac': 4766 obj.mac = Reader.read_string(reader) 4767 elif tag == 'name': 4768 obj.name = Reader.read_string(reader) 4769 elif tag == 'subnet_name': 4770 obj.subnet_name = Reader.read_string(reader) 4771 else: 4772 reader.next_element() 4773 for link in links: 4774 ExternalDiscoveredHostReader._process_link(link, obj) 4775 4776 # Discard the end tag: 4777 reader.read() 4778 4779 return obj 4780 4781 @staticmethod 4782 def read_many(reader): 4783 # Do nothing if there aren't more tags: 4784 objs = List() 4785 if not reader.forward(): 4786 return objs 4787 4788 # Process the attributes: 4789 objs.href = reader.get_attribute('href') 4790 4791 # Discard the start tag: 4792 empty = reader.empty_element() 4793 reader.read() 4794 if empty: 4795 return objs 4796 4797 # Process the inner elements: 4798 while reader.forward(): 4799 objs.append(ExternalDiscoveredHostReader.read_one(reader)) 4800 4801 # Discard the end tag: 4802 reader.read() 4803 4804 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4730 @staticmethod 4731 def read_one(reader): 4732 # Do nothing if there aren't more tags: 4733 if not reader.forward(): 4734 return None 4735 4736 # Create the object: 4737 obj = types.ExternalDiscoveredHost() 4738 4739 # Process the attributes: 4740 obj.href = reader.get_attribute('href') 4741 value = reader.get_attribute('id') 4742 if value is not None: 4743 obj.id = value 4744 4745 # Discard the start tag: 4746 empty = reader.empty_element() 4747 reader.read() 4748 if empty: 4749 return obj 4750 4751 # Process the inner elements: 4752 links = [] 4753 while reader.forward(): 4754 tag = reader.node_name() 4755 if tag == 'comment': 4756 obj.comment = Reader.read_string(reader) 4757 elif tag == 'description': 4758 obj.description = Reader.read_string(reader) 4759 elif tag == 'external_host_provider': 4760 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4761 elif tag == 'ip': 4762 obj.ip = Reader.read_string(reader) 4763 elif tag == 'last_report': 4764 obj.last_report = Reader.read_string(reader) 4765 elif tag == 'mac': 4766 obj.mac = Reader.read_string(reader) 4767 elif tag == 'name': 4768 obj.name = Reader.read_string(reader) 4769 elif tag == 'subnet_name': 4770 obj.subnet_name = Reader.read_string(reader) 4771 else: 4772 reader.next_element() 4773 for link in links: 4774 ExternalDiscoveredHostReader._process_link(link, obj) 4775 4776 # Discard the end tag: 4777 reader.read() 4778 4779 return obj
4781 @staticmethod 4782 def read_many(reader): 4783 # Do nothing if there aren't more tags: 4784 objs = List() 4785 if not reader.forward(): 4786 return objs 4787 4788 # Process the attributes: 4789 objs.href = reader.get_attribute('href') 4790 4791 # Discard the start tag: 4792 empty = reader.empty_element() 4793 reader.read() 4794 if empty: 4795 return objs 4796 4797 # Process the inner elements: 4798 while reader.forward(): 4799 objs.append(ExternalDiscoveredHostReader.read_one(reader)) 4800 4801 # Discard the end tag: 4802 reader.read() 4803 4804 return objs
4807class ExternalHostReader(Reader): 4808 4809 def __init__(self): 4810 super(ExternalHostReader, self).__init__() 4811 4812 @staticmethod 4813 def read_one(reader): 4814 # Do nothing if there aren't more tags: 4815 if not reader.forward(): 4816 return None 4817 4818 # Create the object: 4819 obj = types.ExternalHost() 4820 4821 # Process the attributes: 4822 obj.href = reader.get_attribute('href') 4823 value = reader.get_attribute('id') 4824 if value is not None: 4825 obj.id = value 4826 4827 # Discard the start tag: 4828 empty = reader.empty_element() 4829 reader.read() 4830 if empty: 4831 return obj 4832 4833 # Process the inner elements: 4834 links = [] 4835 while reader.forward(): 4836 tag = reader.node_name() 4837 if tag == 'address': 4838 obj.address = Reader.read_string(reader) 4839 elif tag == 'comment': 4840 obj.comment = Reader.read_string(reader) 4841 elif tag == 'description': 4842 obj.description = Reader.read_string(reader) 4843 elif tag == 'external_host_provider': 4844 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4845 elif tag == 'name': 4846 obj.name = Reader.read_string(reader) 4847 else: 4848 reader.next_element() 4849 for link in links: 4850 ExternalHostReader._process_link(link, obj) 4851 4852 # Discard the end tag: 4853 reader.read() 4854 4855 return obj 4856 4857 @staticmethod 4858 def read_many(reader): 4859 # Do nothing if there aren't more tags: 4860 objs = List() 4861 if not reader.forward(): 4862 return objs 4863 4864 # Process the attributes: 4865 objs.href = reader.get_attribute('href') 4866 4867 # Discard the start tag: 4868 empty = reader.empty_element() 4869 reader.read() 4870 if empty: 4871 return objs 4872 4873 # Process the inner elements: 4874 while reader.forward(): 4875 objs.append(ExternalHostReader.read_one(reader)) 4876 4877 # Discard the end tag: 4878 reader.read() 4879 4880 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4812 @staticmethod 4813 def read_one(reader): 4814 # Do nothing if there aren't more tags: 4815 if not reader.forward(): 4816 return None 4817 4818 # Create the object: 4819 obj = types.ExternalHost() 4820 4821 # Process the attributes: 4822 obj.href = reader.get_attribute('href') 4823 value = reader.get_attribute('id') 4824 if value is not None: 4825 obj.id = value 4826 4827 # Discard the start tag: 4828 empty = reader.empty_element() 4829 reader.read() 4830 if empty: 4831 return obj 4832 4833 # Process the inner elements: 4834 links = [] 4835 while reader.forward(): 4836 tag = reader.node_name() 4837 if tag == 'address': 4838 obj.address = Reader.read_string(reader) 4839 elif tag == 'comment': 4840 obj.comment = Reader.read_string(reader) 4841 elif tag == 'description': 4842 obj.description = Reader.read_string(reader) 4843 elif tag == 'external_host_provider': 4844 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4845 elif tag == 'name': 4846 obj.name = Reader.read_string(reader) 4847 else: 4848 reader.next_element() 4849 for link in links: 4850 ExternalHostReader._process_link(link, obj) 4851 4852 # Discard the end tag: 4853 reader.read() 4854 4855 return obj
4857 @staticmethod 4858 def read_many(reader): 4859 # Do nothing if there aren't more tags: 4860 objs = List() 4861 if not reader.forward(): 4862 return objs 4863 4864 # Process the attributes: 4865 objs.href = reader.get_attribute('href') 4866 4867 # Discard the start tag: 4868 empty = reader.empty_element() 4869 reader.read() 4870 if empty: 4871 return objs 4872 4873 # Process the inner elements: 4874 while reader.forward(): 4875 objs.append(ExternalHostReader.read_one(reader)) 4876 4877 # Discard the end tag: 4878 reader.read() 4879 4880 return objs
4883class ExternalHostGroupReader(Reader): 4884 4885 def __init__(self): 4886 super(ExternalHostGroupReader, self).__init__() 4887 4888 @staticmethod 4889 def read_one(reader): 4890 # Do nothing if there aren't more tags: 4891 if not reader.forward(): 4892 return None 4893 4894 # Create the object: 4895 obj = types.ExternalHostGroup() 4896 4897 # Process the attributes: 4898 obj.href = reader.get_attribute('href') 4899 value = reader.get_attribute('id') 4900 if value is not None: 4901 obj.id = value 4902 4903 # Discard the start tag: 4904 empty = reader.empty_element() 4905 reader.read() 4906 if empty: 4907 return obj 4908 4909 # Process the inner elements: 4910 links = [] 4911 while reader.forward(): 4912 tag = reader.node_name() 4913 if tag == 'architecture_name': 4914 obj.architecture_name = Reader.read_string(reader) 4915 elif tag == 'comment': 4916 obj.comment = Reader.read_string(reader) 4917 elif tag == 'description': 4918 obj.description = Reader.read_string(reader) 4919 elif tag == 'domain_name': 4920 obj.domain_name = Reader.read_string(reader) 4921 elif tag == 'external_host_provider': 4922 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4923 elif tag == 'name': 4924 obj.name = Reader.read_string(reader) 4925 elif tag == 'operating_system_name': 4926 obj.operating_system_name = Reader.read_string(reader) 4927 elif tag == 'subnet_name': 4928 obj.subnet_name = Reader.read_string(reader) 4929 else: 4930 reader.next_element() 4931 for link in links: 4932 ExternalHostGroupReader._process_link(link, obj) 4933 4934 # Discard the end tag: 4935 reader.read() 4936 4937 return obj 4938 4939 @staticmethod 4940 def read_many(reader): 4941 # Do nothing if there aren't more tags: 4942 objs = List() 4943 if not reader.forward(): 4944 return objs 4945 4946 # Process the attributes: 4947 objs.href = reader.get_attribute('href') 4948 4949 # Discard the start tag: 4950 empty = reader.empty_element() 4951 reader.read() 4952 if empty: 4953 return objs 4954 4955 # Process the inner elements: 4956 while reader.forward(): 4957 objs.append(ExternalHostGroupReader.read_one(reader)) 4958 4959 # Discard the end tag: 4960 reader.read() 4961 4962 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4888 @staticmethod 4889 def read_one(reader): 4890 # Do nothing if there aren't more tags: 4891 if not reader.forward(): 4892 return None 4893 4894 # Create the object: 4895 obj = types.ExternalHostGroup() 4896 4897 # Process the attributes: 4898 obj.href = reader.get_attribute('href') 4899 value = reader.get_attribute('id') 4900 if value is not None: 4901 obj.id = value 4902 4903 # Discard the start tag: 4904 empty = reader.empty_element() 4905 reader.read() 4906 if empty: 4907 return obj 4908 4909 # Process the inner elements: 4910 links = [] 4911 while reader.forward(): 4912 tag = reader.node_name() 4913 if tag == 'architecture_name': 4914 obj.architecture_name = Reader.read_string(reader) 4915 elif tag == 'comment': 4916 obj.comment = Reader.read_string(reader) 4917 elif tag == 'description': 4918 obj.description = Reader.read_string(reader) 4919 elif tag == 'domain_name': 4920 obj.domain_name = Reader.read_string(reader) 4921 elif tag == 'external_host_provider': 4922 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 4923 elif tag == 'name': 4924 obj.name = Reader.read_string(reader) 4925 elif tag == 'operating_system_name': 4926 obj.operating_system_name = Reader.read_string(reader) 4927 elif tag == 'subnet_name': 4928 obj.subnet_name = Reader.read_string(reader) 4929 else: 4930 reader.next_element() 4931 for link in links: 4932 ExternalHostGroupReader._process_link(link, obj) 4933 4934 # Discard the end tag: 4935 reader.read() 4936 4937 return obj
4939 @staticmethod 4940 def read_many(reader): 4941 # Do nothing if there aren't more tags: 4942 objs = List() 4943 if not reader.forward(): 4944 return objs 4945 4946 # Process the attributes: 4947 objs.href = reader.get_attribute('href') 4948 4949 # Discard the start tag: 4950 empty = reader.empty_element() 4951 reader.read() 4952 if empty: 4953 return objs 4954 4955 # Process the inner elements: 4956 while reader.forward(): 4957 objs.append(ExternalHostGroupReader.read_one(reader)) 4958 4959 # Discard the end tag: 4960 reader.read() 4961 4962 return objs
4965class ExternalHostProviderReader(Reader): 4966 4967 def __init__(self): 4968 super(ExternalHostProviderReader, self).__init__() 4969 4970 @staticmethod 4971 def read_one(reader): 4972 # Do nothing if there aren't more tags: 4973 if not reader.forward(): 4974 return None 4975 4976 # Create the object: 4977 obj = types.ExternalHostProvider() 4978 4979 # Process the attributes: 4980 obj.href = reader.get_attribute('href') 4981 value = reader.get_attribute('id') 4982 if value is not None: 4983 obj.id = value 4984 4985 # Discard the start tag: 4986 empty = reader.empty_element() 4987 reader.read() 4988 if empty: 4989 return obj 4990 4991 # Process the inner elements: 4992 links = [] 4993 while reader.forward(): 4994 tag = reader.node_name() 4995 if tag == 'authentication_url': 4996 obj.authentication_url = Reader.read_string(reader) 4997 elif tag == 'certificates': 4998 obj.certificates = CertificateReader.read_many(reader) 4999 elif tag == 'comment': 5000 obj.comment = Reader.read_string(reader) 5001 elif tag == 'compute_resources': 5002 obj.compute_resources = ExternalComputeResourceReader.read_many(reader) 5003 elif tag == 'description': 5004 obj.description = Reader.read_string(reader) 5005 elif tag == 'discovered_hosts': 5006 obj.discovered_hosts = ExternalDiscoveredHostReader.read_many(reader) 5007 elif tag == 'host_groups': 5008 obj.host_groups = ExternalHostGroupReader.read_many(reader) 5009 elif tag == 'hosts': 5010 obj.hosts = HostReader.read_many(reader) 5011 elif tag == 'name': 5012 obj.name = Reader.read_string(reader) 5013 elif tag == 'password': 5014 obj.password = Reader.read_string(reader) 5015 elif tag == 'properties': 5016 obj.properties = PropertyReader.read_many(reader) 5017 elif tag == 'requires_authentication': 5018 obj.requires_authentication = Reader.read_boolean(reader) 5019 elif tag == 'url': 5020 obj.url = Reader.read_string(reader) 5021 elif tag == 'username': 5022 obj.username = Reader.read_string(reader) 5023 elif tag == 'link': 5024 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5025 reader.next_element() 5026 else: 5027 reader.next_element() 5028 for link in links: 5029 ExternalHostProviderReader._process_link(link, obj) 5030 5031 # Discard the end tag: 5032 reader.read() 5033 5034 return obj 5035 5036 @staticmethod 5037 def read_many(reader): 5038 # Do nothing if there aren't more tags: 5039 objs = List() 5040 if not reader.forward(): 5041 return objs 5042 5043 # Process the attributes: 5044 objs.href = reader.get_attribute('href') 5045 5046 # Discard the start tag: 5047 empty = reader.empty_element() 5048 reader.read() 5049 if empty: 5050 return objs 5051 5052 # Process the inner elements: 5053 while reader.forward(): 5054 objs.append(ExternalHostProviderReader.read_one(reader)) 5055 5056 # Discard the end tag: 5057 reader.read() 5058 5059 return objs 5060 5061 @staticmethod 5062 def _process_link(link, obj): 5063 # Process the attributes: 5064 rel = link[0] 5065 href = link[1] 5066 if href and rel: 5067 if rel == "certificates": 5068 if obj.certificates is not None: 5069 obj.certificates.href = href 5070 else: 5071 obj.certificates = List(href) 5072 elif rel == "computeresources": 5073 if obj.compute_resources is not None: 5074 obj.compute_resources.href = href 5075 else: 5076 obj.compute_resources = List(href) 5077 elif rel == "discoveredhosts": 5078 if obj.discovered_hosts is not None: 5079 obj.discovered_hosts.href = href 5080 else: 5081 obj.discovered_hosts = List(href) 5082 elif rel == "hostgroups": 5083 if obj.host_groups is not None: 5084 obj.host_groups.href = href 5085 else: 5086 obj.host_groups = List(href) 5087 elif rel == "hosts": 5088 if obj.hosts is not None: 5089 obj.hosts.href = href 5090 else: 5091 obj.hosts = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
4970 @staticmethod 4971 def read_one(reader): 4972 # Do nothing if there aren't more tags: 4973 if not reader.forward(): 4974 return None 4975 4976 # Create the object: 4977 obj = types.ExternalHostProvider() 4978 4979 # Process the attributes: 4980 obj.href = reader.get_attribute('href') 4981 value = reader.get_attribute('id') 4982 if value is not None: 4983 obj.id = value 4984 4985 # Discard the start tag: 4986 empty = reader.empty_element() 4987 reader.read() 4988 if empty: 4989 return obj 4990 4991 # Process the inner elements: 4992 links = [] 4993 while reader.forward(): 4994 tag = reader.node_name() 4995 if tag == 'authentication_url': 4996 obj.authentication_url = Reader.read_string(reader) 4997 elif tag == 'certificates': 4998 obj.certificates = CertificateReader.read_many(reader) 4999 elif tag == 'comment': 5000 obj.comment = Reader.read_string(reader) 5001 elif tag == 'compute_resources': 5002 obj.compute_resources = ExternalComputeResourceReader.read_many(reader) 5003 elif tag == 'description': 5004 obj.description = Reader.read_string(reader) 5005 elif tag == 'discovered_hosts': 5006 obj.discovered_hosts = ExternalDiscoveredHostReader.read_many(reader) 5007 elif tag == 'host_groups': 5008 obj.host_groups = ExternalHostGroupReader.read_many(reader) 5009 elif tag == 'hosts': 5010 obj.hosts = HostReader.read_many(reader) 5011 elif tag == 'name': 5012 obj.name = Reader.read_string(reader) 5013 elif tag == 'password': 5014 obj.password = Reader.read_string(reader) 5015 elif tag == 'properties': 5016 obj.properties = PropertyReader.read_many(reader) 5017 elif tag == 'requires_authentication': 5018 obj.requires_authentication = Reader.read_boolean(reader) 5019 elif tag == 'url': 5020 obj.url = Reader.read_string(reader) 5021 elif tag == 'username': 5022 obj.username = Reader.read_string(reader) 5023 elif tag == 'link': 5024 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5025 reader.next_element() 5026 else: 5027 reader.next_element() 5028 for link in links: 5029 ExternalHostProviderReader._process_link(link, obj) 5030 5031 # Discard the end tag: 5032 reader.read() 5033 5034 return obj
5036 @staticmethod 5037 def read_many(reader): 5038 # Do nothing if there aren't more tags: 5039 objs = List() 5040 if not reader.forward(): 5041 return objs 5042 5043 # Process the attributes: 5044 objs.href = reader.get_attribute('href') 5045 5046 # Discard the start tag: 5047 empty = reader.empty_element() 5048 reader.read() 5049 if empty: 5050 return objs 5051 5052 # Process the inner elements: 5053 while reader.forward(): 5054 objs.append(ExternalHostProviderReader.read_one(reader)) 5055 5056 # Discard the end tag: 5057 reader.read() 5058 5059 return objs
5094class ExternalNetworkProviderConfigurationReader(Reader): 5095 5096 def __init__(self): 5097 super(ExternalNetworkProviderConfigurationReader, self).__init__() 5098 5099 @staticmethod 5100 def read_one(reader): 5101 # Do nothing if there aren't more tags: 5102 if not reader.forward(): 5103 return None 5104 5105 # Create the object: 5106 obj = types.ExternalNetworkProviderConfiguration() 5107 5108 # Process the attributes: 5109 obj.href = reader.get_attribute('href') 5110 value = reader.get_attribute('id') 5111 if value is not None: 5112 obj.id = value 5113 5114 # Discard the start tag: 5115 empty = reader.empty_element() 5116 reader.read() 5117 if empty: 5118 return obj 5119 5120 # Process the inner elements: 5121 links = [] 5122 while reader.forward(): 5123 tag = reader.node_name() 5124 if tag == 'comment': 5125 obj.comment = Reader.read_string(reader) 5126 elif tag == 'description': 5127 obj.description = Reader.read_string(reader) 5128 elif tag == 'external_network_provider': 5129 obj.external_network_provider = ExternalProviderReader.read_one(reader) 5130 elif tag == 'host': 5131 obj.host = HostReader.read_one(reader) 5132 elif tag == 'name': 5133 obj.name = Reader.read_string(reader) 5134 else: 5135 reader.next_element() 5136 for link in links: 5137 ExternalNetworkProviderConfigurationReader._process_link(link, obj) 5138 5139 # Discard the end tag: 5140 reader.read() 5141 5142 return obj 5143 5144 @staticmethod 5145 def read_many(reader): 5146 # Do nothing if there aren't more tags: 5147 objs = List() 5148 if not reader.forward(): 5149 return objs 5150 5151 # Process the attributes: 5152 objs.href = reader.get_attribute('href') 5153 5154 # Discard the start tag: 5155 empty = reader.empty_element() 5156 reader.read() 5157 if empty: 5158 return objs 5159 5160 # Process the inner elements: 5161 while reader.forward(): 5162 objs.append(ExternalNetworkProviderConfigurationReader.read_one(reader)) 5163 5164 # Discard the end tag: 5165 reader.read() 5166 5167 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5099 @staticmethod 5100 def read_one(reader): 5101 # Do nothing if there aren't more tags: 5102 if not reader.forward(): 5103 return None 5104 5105 # Create the object: 5106 obj = types.ExternalNetworkProviderConfiguration() 5107 5108 # Process the attributes: 5109 obj.href = reader.get_attribute('href') 5110 value = reader.get_attribute('id') 5111 if value is not None: 5112 obj.id = value 5113 5114 # Discard the start tag: 5115 empty = reader.empty_element() 5116 reader.read() 5117 if empty: 5118 return obj 5119 5120 # Process the inner elements: 5121 links = [] 5122 while reader.forward(): 5123 tag = reader.node_name() 5124 if tag == 'comment': 5125 obj.comment = Reader.read_string(reader) 5126 elif tag == 'description': 5127 obj.description = Reader.read_string(reader) 5128 elif tag == 'external_network_provider': 5129 obj.external_network_provider = ExternalProviderReader.read_one(reader) 5130 elif tag == 'host': 5131 obj.host = HostReader.read_one(reader) 5132 elif tag == 'name': 5133 obj.name = Reader.read_string(reader) 5134 else: 5135 reader.next_element() 5136 for link in links: 5137 ExternalNetworkProviderConfigurationReader._process_link(link, obj) 5138 5139 # Discard the end tag: 5140 reader.read() 5141 5142 return obj
5144 @staticmethod 5145 def read_many(reader): 5146 # Do nothing if there aren't more tags: 5147 objs = List() 5148 if not reader.forward(): 5149 return objs 5150 5151 # Process the attributes: 5152 objs.href = reader.get_attribute('href') 5153 5154 # Discard the start tag: 5155 empty = reader.empty_element() 5156 reader.read() 5157 if empty: 5158 return objs 5159 5160 # Process the inner elements: 5161 while reader.forward(): 5162 objs.append(ExternalNetworkProviderConfigurationReader.read_one(reader)) 5163 5164 # Discard the end tag: 5165 reader.read() 5166 5167 return objs
5170class ExternalProviderReader(Reader): 5171 5172 def __init__(self): 5173 super(ExternalProviderReader, self).__init__() 5174 5175 @staticmethod 5176 def read_one(reader): 5177 # Do nothing if there aren't more tags: 5178 if not reader.forward(): 5179 return None 5180 5181 # Create the object: 5182 obj = types.ExternalProvider() 5183 5184 # Process the attributes: 5185 obj.href = reader.get_attribute('href') 5186 value = reader.get_attribute('id') 5187 if value is not None: 5188 obj.id = value 5189 5190 # Discard the start tag: 5191 empty = reader.empty_element() 5192 reader.read() 5193 if empty: 5194 return obj 5195 5196 # Process the inner elements: 5197 links = [] 5198 while reader.forward(): 5199 tag = reader.node_name() 5200 if tag == 'authentication_url': 5201 obj.authentication_url = Reader.read_string(reader) 5202 elif tag == 'comment': 5203 obj.comment = Reader.read_string(reader) 5204 elif tag == 'description': 5205 obj.description = Reader.read_string(reader) 5206 elif tag == 'name': 5207 obj.name = Reader.read_string(reader) 5208 elif tag == 'password': 5209 obj.password = Reader.read_string(reader) 5210 elif tag == 'properties': 5211 obj.properties = PropertyReader.read_many(reader) 5212 elif tag == 'requires_authentication': 5213 obj.requires_authentication = Reader.read_boolean(reader) 5214 elif tag == 'url': 5215 obj.url = Reader.read_string(reader) 5216 elif tag == 'username': 5217 obj.username = Reader.read_string(reader) 5218 else: 5219 reader.next_element() 5220 for link in links: 5221 ExternalProviderReader._process_link(link, obj) 5222 5223 # Discard the end tag: 5224 reader.read() 5225 5226 return obj 5227 5228 @staticmethod 5229 def read_many(reader): 5230 # Do nothing if there aren't more tags: 5231 objs = List() 5232 if not reader.forward(): 5233 return objs 5234 5235 # Process the attributes: 5236 objs.href = reader.get_attribute('href') 5237 5238 # Discard the start tag: 5239 empty = reader.empty_element() 5240 reader.read() 5241 if empty: 5242 return objs 5243 5244 # Process the inner elements: 5245 while reader.forward(): 5246 objs.append(ExternalProviderReader.read_one(reader)) 5247 5248 # Discard the end tag: 5249 reader.read() 5250 5251 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5175 @staticmethod 5176 def read_one(reader): 5177 # Do nothing if there aren't more tags: 5178 if not reader.forward(): 5179 return None 5180 5181 # Create the object: 5182 obj = types.ExternalProvider() 5183 5184 # Process the attributes: 5185 obj.href = reader.get_attribute('href') 5186 value = reader.get_attribute('id') 5187 if value is not None: 5188 obj.id = value 5189 5190 # Discard the start tag: 5191 empty = reader.empty_element() 5192 reader.read() 5193 if empty: 5194 return obj 5195 5196 # Process the inner elements: 5197 links = [] 5198 while reader.forward(): 5199 tag = reader.node_name() 5200 if tag == 'authentication_url': 5201 obj.authentication_url = Reader.read_string(reader) 5202 elif tag == 'comment': 5203 obj.comment = Reader.read_string(reader) 5204 elif tag == 'description': 5205 obj.description = Reader.read_string(reader) 5206 elif tag == 'name': 5207 obj.name = Reader.read_string(reader) 5208 elif tag == 'password': 5209 obj.password = Reader.read_string(reader) 5210 elif tag == 'properties': 5211 obj.properties = PropertyReader.read_many(reader) 5212 elif tag == 'requires_authentication': 5213 obj.requires_authentication = Reader.read_boolean(reader) 5214 elif tag == 'url': 5215 obj.url = Reader.read_string(reader) 5216 elif tag == 'username': 5217 obj.username = Reader.read_string(reader) 5218 else: 5219 reader.next_element() 5220 for link in links: 5221 ExternalProviderReader._process_link(link, obj) 5222 5223 # Discard the end tag: 5224 reader.read() 5225 5226 return obj
5228 @staticmethod 5229 def read_many(reader): 5230 # Do nothing if there aren't more tags: 5231 objs = List() 5232 if not reader.forward(): 5233 return objs 5234 5235 # Process the attributes: 5236 objs.href = reader.get_attribute('href') 5237 5238 # Discard the start tag: 5239 empty = reader.empty_element() 5240 reader.read() 5241 if empty: 5242 return objs 5243 5244 # Process the inner elements: 5245 while reader.forward(): 5246 objs.append(ExternalProviderReader.read_one(reader)) 5247 5248 # Discard the end tag: 5249 reader.read() 5250 5251 return objs
5254class ExternalTemplateImportReader(Reader): 5255 5256 def __init__(self): 5257 super(ExternalTemplateImportReader, self).__init__() 5258 5259 @staticmethod 5260 def read_one(reader): 5261 # Do nothing if there aren't more tags: 5262 if not reader.forward(): 5263 return None 5264 5265 # Create the object: 5266 obj = types.ExternalTemplateImport() 5267 5268 # Process the attributes: 5269 obj.href = reader.get_attribute('href') 5270 5271 # Discard the start tag: 5272 empty = reader.empty_element() 5273 reader.read() 5274 if empty: 5275 return obj 5276 5277 # Process the inner elements: 5278 links = [] 5279 while reader.forward(): 5280 tag = reader.node_name() 5281 if tag == 'clone': 5282 obj.clone = Reader.read_boolean(reader) 5283 elif tag == 'cluster': 5284 obj.cluster = ClusterReader.read_one(reader) 5285 elif tag == 'cpu_profile': 5286 obj.cpu_profile = CpuProfileReader.read_one(reader) 5287 elif tag == 'host': 5288 obj.host = HostReader.read_one(reader) 5289 elif tag == 'quota': 5290 obj.quota = QuotaReader.read_one(reader) 5291 elif tag == 'storage_domain': 5292 obj.storage_domain = StorageDomainReader.read_one(reader) 5293 elif tag == 'template': 5294 obj.template = TemplateReader.read_one(reader) 5295 elif tag == 'url': 5296 obj.url = Reader.read_string(reader) 5297 else: 5298 reader.next_element() 5299 for link in links: 5300 ExternalTemplateImportReader._process_link(link, obj) 5301 5302 # Discard the end tag: 5303 reader.read() 5304 5305 return obj 5306 5307 @staticmethod 5308 def read_many(reader): 5309 # Do nothing if there aren't more tags: 5310 objs = List() 5311 if not reader.forward(): 5312 return objs 5313 5314 # Process the attributes: 5315 objs.href = reader.get_attribute('href') 5316 5317 # Discard the start tag: 5318 empty = reader.empty_element() 5319 reader.read() 5320 if empty: 5321 return objs 5322 5323 # Process the inner elements: 5324 while reader.forward(): 5325 objs.append(ExternalTemplateImportReader.read_one(reader)) 5326 5327 # Discard the end tag: 5328 reader.read() 5329 5330 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5259 @staticmethod 5260 def read_one(reader): 5261 # Do nothing if there aren't more tags: 5262 if not reader.forward(): 5263 return None 5264 5265 # Create the object: 5266 obj = types.ExternalTemplateImport() 5267 5268 # Process the attributes: 5269 obj.href = reader.get_attribute('href') 5270 5271 # Discard the start tag: 5272 empty = reader.empty_element() 5273 reader.read() 5274 if empty: 5275 return obj 5276 5277 # Process the inner elements: 5278 links = [] 5279 while reader.forward(): 5280 tag = reader.node_name() 5281 if tag == 'clone': 5282 obj.clone = Reader.read_boolean(reader) 5283 elif tag == 'cluster': 5284 obj.cluster = ClusterReader.read_one(reader) 5285 elif tag == 'cpu_profile': 5286 obj.cpu_profile = CpuProfileReader.read_one(reader) 5287 elif tag == 'host': 5288 obj.host = HostReader.read_one(reader) 5289 elif tag == 'quota': 5290 obj.quota = QuotaReader.read_one(reader) 5291 elif tag == 'storage_domain': 5292 obj.storage_domain = StorageDomainReader.read_one(reader) 5293 elif tag == 'template': 5294 obj.template = TemplateReader.read_one(reader) 5295 elif tag == 'url': 5296 obj.url = Reader.read_string(reader) 5297 else: 5298 reader.next_element() 5299 for link in links: 5300 ExternalTemplateImportReader._process_link(link, obj) 5301 5302 # Discard the end tag: 5303 reader.read() 5304 5305 return obj
5307 @staticmethod 5308 def read_many(reader): 5309 # Do nothing if there aren't more tags: 5310 objs = List() 5311 if not reader.forward(): 5312 return objs 5313 5314 # Process the attributes: 5315 objs.href = reader.get_attribute('href') 5316 5317 # Discard the start tag: 5318 empty = reader.empty_element() 5319 reader.read() 5320 if empty: 5321 return objs 5322 5323 # Process the inner elements: 5324 while reader.forward(): 5325 objs.append(ExternalTemplateImportReader.read_one(reader)) 5326 5327 # Discard the end tag: 5328 reader.read() 5329 5330 return objs
5333class ExternalVmImportReader(Reader): 5334 5335 def __init__(self): 5336 super(ExternalVmImportReader, self).__init__() 5337 5338 @staticmethod 5339 def read_one(reader): 5340 # Do nothing if there aren't more tags: 5341 if not reader.forward(): 5342 return None 5343 5344 # Create the object: 5345 obj = types.ExternalVmImport() 5346 5347 # Process the attributes: 5348 obj.href = reader.get_attribute('href') 5349 5350 # Discard the start tag: 5351 empty = reader.empty_element() 5352 reader.read() 5353 if empty: 5354 return obj 5355 5356 # Process the inner elements: 5357 links = [] 5358 while reader.forward(): 5359 tag = reader.node_name() 5360 if tag == 'cluster': 5361 obj.cluster = ClusterReader.read_one(reader) 5362 elif tag == 'cpu_profile': 5363 obj.cpu_profile = CpuProfileReader.read_one(reader) 5364 elif tag == 'drivers_iso': 5365 obj.drivers_iso = FileReader.read_one(reader) 5366 elif tag == 'host': 5367 obj.host = HostReader.read_one(reader) 5368 elif tag == 'name': 5369 obj.name = Reader.read_string(reader) 5370 elif tag == 'password': 5371 obj.password = Reader.read_string(reader) 5372 elif tag == 'provider': 5373 obj.provider = Reader.read_enum(types.ExternalVmProviderType, reader) 5374 elif tag == 'quota': 5375 obj.quota = QuotaReader.read_one(reader) 5376 elif tag == 'sparse': 5377 obj.sparse = Reader.read_boolean(reader) 5378 elif tag == 'storage_domain': 5379 obj.storage_domain = StorageDomainReader.read_one(reader) 5380 elif tag == 'url': 5381 obj.url = Reader.read_string(reader) 5382 elif tag == 'username': 5383 obj.username = Reader.read_string(reader) 5384 elif tag == 'vm': 5385 obj.vm = VmReader.read_one(reader) 5386 else: 5387 reader.next_element() 5388 for link in links: 5389 ExternalVmImportReader._process_link(link, obj) 5390 5391 # Discard the end tag: 5392 reader.read() 5393 5394 return obj 5395 5396 @staticmethod 5397 def read_many(reader): 5398 # Do nothing if there aren't more tags: 5399 objs = List() 5400 if not reader.forward(): 5401 return objs 5402 5403 # Process the attributes: 5404 objs.href = reader.get_attribute('href') 5405 5406 # Discard the start tag: 5407 empty = reader.empty_element() 5408 reader.read() 5409 if empty: 5410 return objs 5411 5412 # Process the inner elements: 5413 while reader.forward(): 5414 objs.append(ExternalVmImportReader.read_one(reader)) 5415 5416 # Discard the end tag: 5417 reader.read() 5418 5419 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5338 @staticmethod 5339 def read_one(reader): 5340 # Do nothing if there aren't more tags: 5341 if not reader.forward(): 5342 return None 5343 5344 # Create the object: 5345 obj = types.ExternalVmImport() 5346 5347 # Process the attributes: 5348 obj.href = reader.get_attribute('href') 5349 5350 # Discard the start tag: 5351 empty = reader.empty_element() 5352 reader.read() 5353 if empty: 5354 return obj 5355 5356 # Process the inner elements: 5357 links = [] 5358 while reader.forward(): 5359 tag = reader.node_name() 5360 if tag == 'cluster': 5361 obj.cluster = ClusterReader.read_one(reader) 5362 elif tag == 'cpu_profile': 5363 obj.cpu_profile = CpuProfileReader.read_one(reader) 5364 elif tag == 'drivers_iso': 5365 obj.drivers_iso = FileReader.read_one(reader) 5366 elif tag == 'host': 5367 obj.host = HostReader.read_one(reader) 5368 elif tag == 'name': 5369 obj.name = Reader.read_string(reader) 5370 elif tag == 'password': 5371 obj.password = Reader.read_string(reader) 5372 elif tag == 'provider': 5373 obj.provider = Reader.read_enum(types.ExternalVmProviderType, reader) 5374 elif tag == 'quota': 5375 obj.quota = QuotaReader.read_one(reader) 5376 elif tag == 'sparse': 5377 obj.sparse = Reader.read_boolean(reader) 5378 elif tag == 'storage_domain': 5379 obj.storage_domain = StorageDomainReader.read_one(reader) 5380 elif tag == 'url': 5381 obj.url = Reader.read_string(reader) 5382 elif tag == 'username': 5383 obj.username = Reader.read_string(reader) 5384 elif tag == 'vm': 5385 obj.vm = VmReader.read_one(reader) 5386 else: 5387 reader.next_element() 5388 for link in links: 5389 ExternalVmImportReader._process_link(link, obj) 5390 5391 # Discard the end tag: 5392 reader.read() 5393 5394 return obj
5396 @staticmethod 5397 def read_many(reader): 5398 # Do nothing if there aren't more tags: 5399 objs = List() 5400 if not reader.forward(): 5401 return objs 5402 5403 # Process the attributes: 5404 objs.href = reader.get_attribute('href') 5405 5406 # Discard the start tag: 5407 empty = reader.empty_element() 5408 reader.read() 5409 if empty: 5410 return objs 5411 5412 # Process the inner elements: 5413 while reader.forward(): 5414 objs.append(ExternalVmImportReader.read_one(reader)) 5415 5416 # Discard the end tag: 5417 reader.read() 5418 5419 return objs
5422class FaultReader(Reader): 5423 5424 def __init__(self): 5425 super(FaultReader, self).__init__() 5426 5427 @staticmethod 5428 def read_one(reader): 5429 # Do nothing if there aren't more tags: 5430 if not reader.forward(): 5431 return None 5432 5433 # Create the object: 5434 obj = types.Fault() 5435 5436 # Process the attributes: 5437 obj.href = reader.get_attribute('href') 5438 5439 # Discard the start tag: 5440 empty = reader.empty_element() 5441 reader.read() 5442 if empty: 5443 return obj 5444 5445 # Process the inner elements: 5446 links = [] 5447 while reader.forward(): 5448 tag = reader.node_name() 5449 if tag == 'detail': 5450 obj.detail = Reader.read_string(reader) 5451 elif tag == 'reason': 5452 obj.reason = Reader.read_string(reader) 5453 else: 5454 reader.next_element() 5455 for link in links: 5456 FaultReader._process_link(link, obj) 5457 5458 # Discard the end tag: 5459 reader.read() 5460 5461 return obj 5462 5463 @staticmethod 5464 def read_many(reader): 5465 # Do nothing if there aren't more tags: 5466 objs = List() 5467 if not reader.forward(): 5468 return objs 5469 5470 # Process the attributes: 5471 objs.href = reader.get_attribute('href') 5472 5473 # Discard the start tag: 5474 empty = reader.empty_element() 5475 reader.read() 5476 if empty: 5477 return objs 5478 5479 # Process the inner elements: 5480 while reader.forward(): 5481 objs.append(FaultReader.read_one(reader)) 5482 5483 # Discard the end tag: 5484 reader.read() 5485 5486 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5427 @staticmethod 5428 def read_one(reader): 5429 # Do nothing if there aren't more tags: 5430 if not reader.forward(): 5431 return None 5432 5433 # Create the object: 5434 obj = types.Fault() 5435 5436 # Process the attributes: 5437 obj.href = reader.get_attribute('href') 5438 5439 # Discard the start tag: 5440 empty = reader.empty_element() 5441 reader.read() 5442 if empty: 5443 return obj 5444 5445 # Process the inner elements: 5446 links = [] 5447 while reader.forward(): 5448 tag = reader.node_name() 5449 if tag == 'detail': 5450 obj.detail = Reader.read_string(reader) 5451 elif tag == 'reason': 5452 obj.reason = Reader.read_string(reader) 5453 else: 5454 reader.next_element() 5455 for link in links: 5456 FaultReader._process_link(link, obj) 5457 5458 # Discard the end tag: 5459 reader.read() 5460 5461 return obj
5463 @staticmethod 5464 def read_many(reader): 5465 # Do nothing if there aren't more tags: 5466 objs = List() 5467 if not reader.forward(): 5468 return objs 5469 5470 # Process the attributes: 5471 objs.href = reader.get_attribute('href') 5472 5473 # Discard the start tag: 5474 empty = reader.empty_element() 5475 reader.read() 5476 if empty: 5477 return objs 5478 5479 # Process the inner elements: 5480 while reader.forward(): 5481 objs.append(FaultReader.read_one(reader)) 5482 5483 # Discard the end tag: 5484 reader.read() 5485 5486 return objs
5489class FencingPolicyReader(Reader): 5490 5491 def __init__(self): 5492 super(FencingPolicyReader, self).__init__() 5493 5494 @staticmethod 5495 def read_one(reader): 5496 # Do nothing if there aren't more tags: 5497 if not reader.forward(): 5498 return None 5499 5500 # Create the object: 5501 obj = types.FencingPolicy() 5502 5503 # Process the attributes: 5504 obj.href = reader.get_attribute('href') 5505 5506 # Discard the start tag: 5507 empty = reader.empty_element() 5508 reader.read() 5509 if empty: 5510 return obj 5511 5512 # Process the inner elements: 5513 links = [] 5514 while reader.forward(): 5515 tag = reader.node_name() 5516 if tag == 'enabled': 5517 obj.enabled = Reader.read_boolean(reader) 5518 elif tag == 'skip_if_connectivity_broken': 5519 obj.skip_if_connectivity_broken = SkipIfConnectivityBrokenReader.read_one(reader) 5520 elif tag == 'skip_if_gluster_bricks_up': 5521 obj.skip_if_gluster_bricks_up = Reader.read_boolean(reader) 5522 elif tag == 'skip_if_gluster_quorum_not_met': 5523 obj.skip_if_gluster_quorum_not_met = Reader.read_boolean(reader) 5524 elif tag == 'skip_if_sd_active': 5525 obj.skip_if_sd_active = SkipIfSdActiveReader.read_one(reader) 5526 else: 5527 reader.next_element() 5528 for link in links: 5529 FencingPolicyReader._process_link(link, obj) 5530 5531 # Discard the end tag: 5532 reader.read() 5533 5534 return obj 5535 5536 @staticmethod 5537 def read_many(reader): 5538 # Do nothing if there aren't more tags: 5539 objs = List() 5540 if not reader.forward(): 5541 return objs 5542 5543 # Process the attributes: 5544 objs.href = reader.get_attribute('href') 5545 5546 # Discard the start tag: 5547 empty = reader.empty_element() 5548 reader.read() 5549 if empty: 5550 return objs 5551 5552 # Process the inner elements: 5553 while reader.forward(): 5554 objs.append(FencingPolicyReader.read_one(reader)) 5555 5556 # Discard the end tag: 5557 reader.read() 5558 5559 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5494 @staticmethod 5495 def read_one(reader): 5496 # Do nothing if there aren't more tags: 5497 if not reader.forward(): 5498 return None 5499 5500 # Create the object: 5501 obj = types.FencingPolicy() 5502 5503 # Process the attributes: 5504 obj.href = reader.get_attribute('href') 5505 5506 # Discard the start tag: 5507 empty = reader.empty_element() 5508 reader.read() 5509 if empty: 5510 return obj 5511 5512 # Process the inner elements: 5513 links = [] 5514 while reader.forward(): 5515 tag = reader.node_name() 5516 if tag == 'enabled': 5517 obj.enabled = Reader.read_boolean(reader) 5518 elif tag == 'skip_if_connectivity_broken': 5519 obj.skip_if_connectivity_broken = SkipIfConnectivityBrokenReader.read_one(reader) 5520 elif tag == 'skip_if_gluster_bricks_up': 5521 obj.skip_if_gluster_bricks_up = Reader.read_boolean(reader) 5522 elif tag == 'skip_if_gluster_quorum_not_met': 5523 obj.skip_if_gluster_quorum_not_met = Reader.read_boolean(reader) 5524 elif tag == 'skip_if_sd_active': 5525 obj.skip_if_sd_active = SkipIfSdActiveReader.read_one(reader) 5526 else: 5527 reader.next_element() 5528 for link in links: 5529 FencingPolicyReader._process_link(link, obj) 5530 5531 # Discard the end tag: 5532 reader.read() 5533 5534 return obj
5536 @staticmethod 5537 def read_many(reader): 5538 # Do nothing if there aren't more tags: 5539 objs = List() 5540 if not reader.forward(): 5541 return objs 5542 5543 # Process the attributes: 5544 objs.href = reader.get_attribute('href') 5545 5546 # Discard the start tag: 5547 empty = reader.empty_element() 5548 reader.read() 5549 if empty: 5550 return objs 5551 5552 # Process the inner elements: 5553 while reader.forward(): 5554 objs.append(FencingPolicyReader.read_one(reader)) 5555 5556 # Discard the end tag: 5557 reader.read() 5558 5559 return objs
5562class FileReader(Reader): 5563 5564 def __init__(self): 5565 super(FileReader, self).__init__() 5566 5567 @staticmethod 5568 def read_one(reader): 5569 # Do nothing if there aren't more tags: 5570 if not reader.forward(): 5571 return None 5572 5573 # Create the object: 5574 obj = types.File() 5575 5576 # Process the attributes: 5577 obj.href = reader.get_attribute('href') 5578 value = reader.get_attribute('id') 5579 if value is not None: 5580 obj.id = value 5581 5582 # Discard the start tag: 5583 empty = reader.empty_element() 5584 reader.read() 5585 if empty: 5586 return obj 5587 5588 # Process the inner elements: 5589 links = [] 5590 while reader.forward(): 5591 tag = reader.node_name() 5592 if tag == 'comment': 5593 obj.comment = Reader.read_string(reader) 5594 elif tag == 'content': 5595 obj.content = Reader.read_string(reader) 5596 elif tag == 'description': 5597 obj.description = Reader.read_string(reader) 5598 elif tag == 'name': 5599 obj.name = Reader.read_string(reader) 5600 elif tag == 'storage_domain': 5601 obj.storage_domain = StorageDomainReader.read_one(reader) 5602 elif tag == 'type': 5603 obj.type = Reader.read_string(reader) 5604 else: 5605 reader.next_element() 5606 for link in links: 5607 FileReader._process_link(link, obj) 5608 5609 # Discard the end tag: 5610 reader.read() 5611 5612 return obj 5613 5614 @staticmethod 5615 def read_many(reader): 5616 # Do nothing if there aren't more tags: 5617 objs = List() 5618 if not reader.forward(): 5619 return objs 5620 5621 # Process the attributes: 5622 objs.href = reader.get_attribute('href') 5623 5624 # Discard the start tag: 5625 empty = reader.empty_element() 5626 reader.read() 5627 if empty: 5628 return objs 5629 5630 # Process the inner elements: 5631 while reader.forward(): 5632 objs.append(FileReader.read_one(reader)) 5633 5634 # Discard the end tag: 5635 reader.read() 5636 5637 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5567 @staticmethod 5568 def read_one(reader): 5569 # Do nothing if there aren't more tags: 5570 if not reader.forward(): 5571 return None 5572 5573 # Create the object: 5574 obj = types.File() 5575 5576 # Process the attributes: 5577 obj.href = reader.get_attribute('href') 5578 value = reader.get_attribute('id') 5579 if value is not None: 5580 obj.id = value 5581 5582 # Discard the start tag: 5583 empty = reader.empty_element() 5584 reader.read() 5585 if empty: 5586 return obj 5587 5588 # Process the inner elements: 5589 links = [] 5590 while reader.forward(): 5591 tag = reader.node_name() 5592 if tag == 'comment': 5593 obj.comment = Reader.read_string(reader) 5594 elif tag == 'content': 5595 obj.content = Reader.read_string(reader) 5596 elif tag == 'description': 5597 obj.description = Reader.read_string(reader) 5598 elif tag == 'name': 5599 obj.name = Reader.read_string(reader) 5600 elif tag == 'storage_domain': 5601 obj.storage_domain = StorageDomainReader.read_one(reader) 5602 elif tag == 'type': 5603 obj.type = Reader.read_string(reader) 5604 else: 5605 reader.next_element() 5606 for link in links: 5607 FileReader._process_link(link, obj) 5608 5609 # Discard the end tag: 5610 reader.read() 5611 5612 return obj
5614 @staticmethod 5615 def read_many(reader): 5616 # Do nothing if there aren't more tags: 5617 objs = List() 5618 if not reader.forward(): 5619 return objs 5620 5621 # Process the attributes: 5622 objs.href = reader.get_attribute('href') 5623 5624 # Discard the start tag: 5625 empty = reader.empty_element() 5626 reader.read() 5627 if empty: 5628 return objs 5629 5630 # Process the inner elements: 5631 while reader.forward(): 5632 objs.append(FileReader.read_one(reader)) 5633 5634 # Discard the end tag: 5635 reader.read() 5636 5637 return objs
5640class FilterReader(Reader): 5641 5642 def __init__(self): 5643 super(FilterReader, self).__init__() 5644 5645 @staticmethod 5646 def read_one(reader): 5647 # Do nothing if there aren't more tags: 5648 if not reader.forward(): 5649 return None 5650 5651 # Create the object: 5652 obj = types.Filter() 5653 5654 # Process the attributes: 5655 obj.href = reader.get_attribute('href') 5656 value = reader.get_attribute('id') 5657 if value is not None: 5658 obj.id = value 5659 5660 # Discard the start tag: 5661 empty = reader.empty_element() 5662 reader.read() 5663 if empty: 5664 return obj 5665 5666 # Process the inner elements: 5667 links = [] 5668 while reader.forward(): 5669 tag = reader.node_name() 5670 if tag == 'comment': 5671 obj.comment = Reader.read_string(reader) 5672 elif tag == 'description': 5673 obj.description = Reader.read_string(reader) 5674 elif tag == 'name': 5675 obj.name = Reader.read_string(reader) 5676 elif tag == 'position': 5677 obj.position = Reader.read_integer(reader) 5678 elif tag == 'scheduling_policy_unit': 5679 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 5680 else: 5681 reader.next_element() 5682 for link in links: 5683 FilterReader._process_link(link, obj) 5684 5685 # Discard the end tag: 5686 reader.read() 5687 5688 return obj 5689 5690 @staticmethod 5691 def read_many(reader): 5692 # Do nothing if there aren't more tags: 5693 objs = List() 5694 if not reader.forward(): 5695 return objs 5696 5697 # Process the attributes: 5698 objs.href = reader.get_attribute('href') 5699 5700 # Discard the start tag: 5701 empty = reader.empty_element() 5702 reader.read() 5703 if empty: 5704 return objs 5705 5706 # Process the inner elements: 5707 while reader.forward(): 5708 objs.append(FilterReader.read_one(reader)) 5709 5710 # Discard the end tag: 5711 reader.read() 5712 5713 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5645 @staticmethod 5646 def read_one(reader): 5647 # Do nothing if there aren't more tags: 5648 if not reader.forward(): 5649 return None 5650 5651 # Create the object: 5652 obj = types.Filter() 5653 5654 # Process the attributes: 5655 obj.href = reader.get_attribute('href') 5656 value = reader.get_attribute('id') 5657 if value is not None: 5658 obj.id = value 5659 5660 # Discard the start tag: 5661 empty = reader.empty_element() 5662 reader.read() 5663 if empty: 5664 return obj 5665 5666 # Process the inner elements: 5667 links = [] 5668 while reader.forward(): 5669 tag = reader.node_name() 5670 if tag == 'comment': 5671 obj.comment = Reader.read_string(reader) 5672 elif tag == 'description': 5673 obj.description = Reader.read_string(reader) 5674 elif tag == 'name': 5675 obj.name = Reader.read_string(reader) 5676 elif tag == 'position': 5677 obj.position = Reader.read_integer(reader) 5678 elif tag == 'scheduling_policy_unit': 5679 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 5680 else: 5681 reader.next_element() 5682 for link in links: 5683 FilterReader._process_link(link, obj) 5684 5685 # Discard the end tag: 5686 reader.read() 5687 5688 return obj
5690 @staticmethod 5691 def read_many(reader): 5692 # Do nothing if there aren't more tags: 5693 objs = List() 5694 if not reader.forward(): 5695 return objs 5696 5697 # Process the attributes: 5698 objs.href = reader.get_attribute('href') 5699 5700 # Discard the start tag: 5701 empty = reader.empty_element() 5702 reader.read() 5703 if empty: 5704 return objs 5705 5706 # Process the inner elements: 5707 while reader.forward(): 5708 objs.append(FilterReader.read_one(reader)) 5709 5710 # Discard the end tag: 5711 reader.read() 5712 5713 return objs
5716class FloppyReader(Reader): 5717 5718 def __init__(self): 5719 super(FloppyReader, self).__init__() 5720 5721 @staticmethod 5722 def read_one(reader): 5723 # Do nothing if there aren't more tags: 5724 if not reader.forward(): 5725 return None 5726 5727 # Create the object: 5728 obj = types.Floppy() 5729 5730 # Process the attributes: 5731 obj.href = reader.get_attribute('href') 5732 value = reader.get_attribute('id') 5733 if value is not None: 5734 obj.id = value 5735 5736 # Discard the start tag: 5737 empty = reader.empty_element() 5738 reader.read() 5739 if empty: 5740 return obj 5741 5742 # Process the inner elements: 5743 links = [] 5744 while reader.forward(): 5745 tag = reader.node_name() 5746 if tag == 'comment': 5747 obj.comment = Reader.read_string(reader) 5748 elif tag == 'description': 5749 obj.description = Reader.read_string(reader) 5750 elif tag == 'file': 5751 obj.file = FileReader.read_one(reader) 5752 elif tag == 'instance_type': 5753 obj.instance_type = InstanceTypeReader.read_one(reader) 5754 elif tag == 'name': 5755 obj.name = Reader.read_string(reader) 5756 elif tag == 'template': 5757 obj.template = TemplateReader.read_one(reader) 5758 elif tag == 'vm': 5759 obj.vm = VmReader.read_one(reader) 5760 elif tag == 'vms': 5761 obj.vms = VmReader.read_many(reader) 5762 elif tag == 'link': 5763 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5764 reader.next_element() 5765 else: 5766 reader.next_element() 5767 for link in links: 5768 FloppyReader._process_link(link, obj) 5769 5770 # Discard the end tag: 5771 reader.read() 5772 5773 return obj 5774 5775 @staticmethod 5776 def read_many(reader): 5777 # Do nothing if there aren't more tags: 5778 objs = List() 5779 if not reader.forward(): 5780 return objs 5781 5782 # Process the attributes: 5783 objs.href = reader.get_attribute('href') 5784 5785 # Discard the start tag: 5786 empty = reader.empty_element() 5787 reader.read() 5788 if empty: 5789 return objs 5790 5791 # Process the inner elements: 5792 while reader.forward(): 5793 objs.append(FloppyReader.read_one(reader)) 5794 5795 # Discard the end tag: 5796 reader.read() 5797 5798 return objs 5799 5800 @staticmethod 5801 def _process_link(link, obj): 5802 # Process the attributes: 5803 rel = link[0] 5804 href = link[1] 5805 if href and rel: 5806 if rel == "vms": 5807 if obj.vms is not None: 5808 obj.vms.href = href 5809 else: 5810 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5721 @staticmethod 5722 def read_one(reader): 5723 # Do nothing if there aren't more tags: 5724 if not reader.forward(): 5725 return None 5726 5727 # Create the object: 5728 obj = types.Floppy() 5729 5730 # Process the attributes: 5731 obj.href = reader.get_attribute('href') 5732 value = reader.get_attribute('id') 5733 if value is not None: 5734 obj.id = value 5735 5736 # Discard the start tag: 5737 empty = reader.empty_element() 5738 reader.read() 5739 if empty: 5740 return obj 5741 5742 # Process the inner elements: 5743 links = [] 5744 while reader.forward(): 5745 tag = reader.node_name() 5746 if tag == 'comment': 5747 obj.comment = Reader.read_string(reader) 5748 elif tag == 'description': 5749 obj.description = Reader.read_string(reader) 5750 elif tag == 'file': 5751 obj.file = FileReader.read_one(reader) 5752 elif tag == 'instance_type': 5753 obj.instance_type = InstanceTypeReader.read_one(reader) 5754 elif tag == 'name': 5755 obj.name = Reader.read_string(reader) 5756 elif tag == 'template': 5757 obj.template = TemplateReader.read_one(reader) 5758 elif tag == 'vm': 5759 obj.vm = VmReader.read_one(reader) 5760 elif tag == 'vms': 5761 obj.vms = VmReader.read_many(reader) 5762 elif tag == 'link': 5763 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5764 reader.next_element() 5765 else: 5766 reader.next_element() 5767 for link in links: 5768 FloppyReader._process_link(link, obj) 5769 5770 # Discard the end tag: 5771 reader.read() 5772 5773 return obj
5775 @staticmethod 5776 def read_many(reader): 5777 # Do nothing if there aren't more tags: 5778 objs = List() 5779 if not reader.forward(): 5780 return objs 5781 5782 # Process the attributes: 5783 objs.href = reader.get_attribute('href') 5784 5785 # Discard the start tag: 5786 empty = reader.empty_element() 5787 reader.read() 5788 if empty: 5789 return objs 5790 5791 # Process the inner elements: 5792 while reader.forward(): 5793 objs.append(FloppyReader.read_one(reader)) 5794 5795 # Discard the end tag: 5796 reader.read() 5797 5798 return objs
5813class FopStatisticReader(Reader): 5814 5815 def __init__(self): 5816 super(FopStatisticReader, self).__init__() 5817 5818 @staticmethod 5819 def read_one(reader): 5820 # Do nothing if there aren't more tags: 5821 if not reader.forward(): 5822 return None 5823 5824 # Create the object: 5825 obj = types.FopStatistic() 5826 5827 # Process the attributes: 5828 obj.href = reader.get_attribute('href') 5829 5830 # Discard the start tag: 5831 empty = reader.empty_element() 5832 reader.read() 5833 if empty: 5834 return obj 5835 5836 # Process the inner elements: 5837 links = [] 5838 while reader.forward(): 5839 tag = reader.node_name() 5840 if tag == 'name': 5841 obj.name = Reader.read_string(reader) 5842 elif tag == 'statistics': 5843 obj.statistics = StatisticReader.read_many(reader) 5844 else: 5845 reader.next_element() 5846 for link in links: 5847 FopStatisticReader._process_link(link, obj) 5848 5849 # Discard the end tag: 5850 reader.read() 5851 5852 return obj 5853 5854 @staticmethod 5855 def read_many(reader): 5856 # Do nothing if there aren't more tags: 5857 objs = List() 5858 if not reader.forward(): 5859 return objs 5860 5861 # Process the attributes: 5862 objs.href = reader.get_attribute('href') 5863 5864 # Discard the start tag: 5865 empty = reader.empty_element() 5866 reader.read() 5867 if empty: 5868 return objs 5869 5870 # Process the inner elements: 5871 while reader.forward(): 5872 objs.append(FopStatisticReader.read_one(reader)) 5873 5874 # Discard the end tag: 5875 reader.read() 5876 5877 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5818 @staticmethod 5819 def read_one(reader): 5820 # Do nothing if there aren't more tags: 5821 if not reader.forward(): 5822 return None 5823 5824 # Create the object: 5825 obj = types.FopStatistic() 5826 5827 # Process the attributes: 5828 obj.href = reader.get_attribute('href') 5829 5830 # Discard the start tag: 5831 empty = reader.empty_element() 5832 reader.read() 5833 if empty: 5834 return obj 5835 5836 # Process the inner elements: 5837 links = [] 5838 while reader.forward(): 5839 tag = reader.node_name() 5840 if tag == 'name': 5841 obj.name = Reader.read_string(reader) 5842 elif tag == 'statistics': 5843 obj.statistics = StatisticReader.read_many(reader) 5844 else: 5845 reader.next_element() 5846 for link in links: 5847 FopStatisticReader._process_link(link, obj) 5848 5849 # Discard the end tag: 5850 reader.read() 5851 5852 return obj
5854 @staticmethod 5855 def read_many(reader): 5856 # Do nothing if there aren't more tags: 5857 objs = List() 5858 if not reader.forward(): 5859 return objs 5860 5861 # Process the attributes: 5862 objs.href = reader.get_attribute('href') 5863 5864 # Discard the start tag: 5865 empty = reader.empty_element() 5866 reader.read() 5867 if empty: 5868 return objs 5869 5870 # Process the inner elements: 5871 while reader.forward(): 5872 objs.append(FopStatisticReader.read_one(reader)) 5873 5874 # Discard the end tag: 5875 reader.read() 5876 5877 return objs
5880class GlusterBrickReader(Reader): 5881 5882 def __init__(self): 5883 super(GlusterBrickReader, self).__init__() 5884 5885 @staticmethod 5886 def read_one(reader): 5887 # Do nothing if there aren't more tags: 5888 if not reader.forward(): 5889 return None 5890 5891 # Create the object: 5892 obj = types.GlusterBrick() 5893 5894 # Process the attributes: 5895 obj.href = reader.get_attribute('href') 5896 value = reader.get_attribute('id') 5897 if value is not None: 5898 obj.id = value 5899 5900 # Discard the start tag: 5901 empty = reader.empty_element() 5902 reader.read() 5903 if empty: 5904 return obj 5905 5906 # Process the inner elements: 5907 links = [] 5908 while reader.forward(): 5909 tag = reader.node_name() 5910 if tag == 'brick_dir': 5911 obj.brick_dir = Reader.read_string(reader) 5912 elif tag == 'comment': 5913 obj.comment = Reader.read_string(reader) 5914 elif tag == 'description': 5915 obj.description = Reader.read_string(reader) 5916 elif tag == 'device': 5917 obj.device = Reader.read_string(reader) 5918 elif tag == 'fs_name': 5919 obj.fs_name = Reader.read_string(reader) 5920 elif tag == 'gluster_clients': 5921 obj.gluster_clients = GlusterClientReader.read_many(reader) 5922 elif tag == 'gluster_volume': 5923 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 5924 elif tag == 'instance_type': 5925 obj.instance_type = InstanceTypeReader.read_one(reader) 5926 elif tag == 'memory_pools': 5927 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 5928 elif tag == 'mnt_options': 5929 obj.mnt_options = Reader.read_string(reader) 5930 elif tag == 'name': 5931 obj.name = Reader.read_string(reader) 5932 elif tag == 'pid': 5933 obj.pid = Reader.read_integer(reader) 5934 elif tag == 'port': 5935 obj.port = Reader.read_integer(reader) 5936 elif tag == 'server_id': 5937 obj.server_id = Reader.read_string(reader) 5938 elif tag == 'statistics': 5939 obj.statistics = StatisticReader.read_many(reader) 5940 elif tag == 'status': 5941 obj.status = Reader.read_enum(types.GlusterBrickStatus, reader) 5942 elif tag == 'template': 5943 obj.template = TemplateReader.read_one(reader) 5944 elif tag == 'vm': 5945 obj.vm = VmReader.read_one(reader) 5946 elif tag == 'vms': 5947 obj.vms = VmReader.read_many(reader) 5948 elif tag == 'link': 5949 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5950 reader.next_element() 5951 else: 5952 reader.next_element() 5953 for link in links: 5954 GlusterBrickReader._process_link(link, obj) 5955 5956 # Discard the end tag: 5957 reader.read() 5958 5959 return obj 5960 5961 @staticmethod 5962 def read_many(reader): 5963 # Do nothing if there aren't more tags: 5964 objs = List() 5965 if not reader.forward(): 5966 return objs 5967 5968 # Process the attributes: 5969 objs.href = reader.get_attribute('href') 5970 5971 # Discard the start tag: 5972 empty = reader.empty_element() 5973 reader.read() 5974 if empty: 5975 return objs 5976 5977 # Process the inner elements: 5978 while reader.forward(): 5979 objs.append(GlusterBrickReader.read_one(reader)) 5980 5981 # Discard the end tag: 5982 reader.read() 5983 5984 return objs 5985 5986 @staticmethod 5987 def _process_link(link, obj): 5988 # Process the attributes: 5989 rel = link[0] 5990 href = link[1] 5991 if href and rel: 5992 if rel == "statistics": 5993 if obj.statistics is not None: 5994 obj.statistics.href = href 5995 else: 5996 obj.statistics = List(href) 5997 elif rel == "vms": 5998 if obj.vms is not None: 5999 obj.vms.href = href 6000 else: 6001 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
5885 @staticmethod 5886 def read_one(reader): 5887 # Do nothing if there aren't more tags: 5888 if not reader.forward(): 5889 return None 5890 5891 # Create the object: 5892 obj = types.GlusterBrick() 5893 5894 # Process the attributes: 5895 obj.href = reader.get_attribute('href') 5896 value = reader.get_attribute('id') 5897 if value is not None: 5898 obj.id = value 5899 5900 # Discard the start tag: 5901 empty = reader.empty_element() 5902 reader.read() 5903 if empty: 5904 return obj 5905 5906 # Process the inner elements: 5907 links = [] 5908 while reader.forward(): 5909 tag = reader.node_name() 5910 if tag == 'brick_dir': 5911 obj.brick_dir = Reader.read_string(reader) 5912 elif tag == 'comment': 5913 obj.comment = Reader.read_string(reader) 5914 elif tag == 'description': 5915 obj.description = Reader.read_string(reader) 5916 elif tag == 'device': 5917 obj.device = Reader.read_string(reader) 5918 elif tag == 'fs_name': 5919 obj.fs_name = Reader.read_string(reader) 5920 elif tag == 'gluster_clients': 5921 obj.gluster_clients = GlusterClientReader.read_many(reader) 5922 elif tag == 'gluster_volume': 5923 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 5924 elif tag == 'instance_type': 5925 obj.instance_type = InstanceTypeReader.read_one(reader) 5926 elif tag == 'memory_pools': 5927 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 5928 elif tag == 'mnt_options': 5929 obj.mnt_options = Reader.read_string(reader) 5930 elif tag == 'name': 5931 obj.name = Reader.read_string(reader) 5932 elif tag == 'pid': 5933 obj.pid = Reader.read_integer(reader) 5934 elif tag == 'port': 5935 obj.port = Reader.read_integer(reader) 5936 elif tag == 'server_id': 5937 obj.server_id = Reader.read_string(reader) 5938 elif tag == 'statistics': 5939 obj.statistics = StatisticReader.read_many(reader) 5940 elif tag == 'status': 5941 obj.status = Reader.read_enum(types.GlusterBrickStatus, reader) 5942 elif tag == 'template': 5943 obj.template = TemplateReader.read_one(reader) 5944 elif tag == 'vm': 5945 obj.vm = VmReader.read_one(reader) 5946 elif tag == 'vms': 5947 obj.vms = VmReader.read_many(reader) 5948 elif tag == 'link': 5949 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 5950 reader.next_element() 5951 else: 5952 reader.next_element() 5953 for link in links: 5954 GlusterBrickReader._process_link(link, obj) 5955 5956 # Discard the end tag: 5957 reader.read() 5958 5959 return obj
5961 @staticmethod 5962 def read_many(reader): 5963 # Do nothing if there aren't more tags: 5964 objs = List() 5965 if not reader.forward(): 5966 return objs 5967 5968 # Process the attributes: 5969 objs.href = reader.get_attribute('href') 5970 5971 # Discard the start tag: 5972 empty = reader.empty_element() 5973 reader.read() 5974 if empty: 5975 return objs 5976 5977 # Process the inner elements: 5978 while reader.forward(): 5979 objs.append(GlusterBrickReader.read_one(reader)) 5980 5981 # Discard the end tag: 5982 reader.read() 5983 5984 return objs
6004class GlusterBrickAdvancedDetailsReader(Reader): 6005 6006 def __init__(self): 6007 super(GlusterBrickAdvancedDetailsReader, self).__init__() 6008 6009 @staticmethod 6010 def read_one(reader): 6011 # Do nothing if there aren't more tags: 6012 if not reader.forward(): 6013 return None 6014 6015 # Create the object: 6016 obj = types.GlusterBrickAdvancedDetails() 6017 6018 # Process the attributes: 6019 obj.href = reader.get_attribute('href') 6020 value = reader.get_attribute('id') 6021 if value is not None: 6022 obj.id = value 6023 6024 # Discard the start tag: 6025 empty = reader.empty_element() 6026 reader.read() 6027 if empty: 6028 return obj 6029 6030 # Process the inner elements: 6031 links = [] 6032 while reader.forward(): 6033 tag = reader.node_name() 6034 if tag == 'comment': 6035 obj.comment = Reader.read_string(reader) 6036 elif tag == 'description': 6037 obj.description = Reader.read_string(reader) 6038 elif tag == 'device': 6039 obj.device = Reader.read_string(reader) 6040 elif tag == 'fs_name': 6041 obj.fs_name = Reader.read_string(reader) 6042 elif tag == 'gluster_clients': 6043 obj.gluster_clients = GlusterClientReader.read_many(reader) 6044 elif tag == 'instance_type': 6045 obj.instance_type = InstanceTypeReader.read_one(reader) 6046 elif tag == 'memory_pools': 6047 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6048 elif tag == 'mnt_options': 6049 obj.mnt_options = Reader.read_string(reader) 6050 elif tag == 'name': 6051 obj.name = Reader.read_string(reader) 6052 elif tag == 'pid': 6053 obj.pid = Reader.read_integer(reader) 6054 elif tag == 'port': 6055 obj.port = Reader.read_integer(reader) 6056 elif tag == 'template': 6057 obj.template = TemplateReader.read_one(reader) 6058 elif tag == 'vm': 6059 obj.vm = VmReader.read_one(reader) 6060 elif tag == 'vms': 6061 obj.vms = VmReader.read_many(reader) 6062 elif tag == 'link': 6063 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6064 reader.next_element() 6065 else: 6066 reader.next_element() 6067 for link in links: 6068 GlusterBrickAdvancedDetailsReader._process_link(link, obj) 6069 6070 # Discard the end tag: 6071 reader.read() 6072 6073 return obj 6074 6075 @staticmethod 6076 def read_many(reader): 6077 # Do nothing if there aren't more tags: 6078 objs = List() 6079 if not reader.forward(): 6080 return objs 6081 6082 # Process the attributes: 6083 objs.href = reader.get_attribute('href') 6084 6085 # Discard the start tag: 6086 empty = reader.empty_element() 6087 reader.read() 6088 if empty: 6089 return objs 6090 6091 # Process the inner elements: 6092 while reader.forward(): 6093 objs.append(GlusterBrickAdvancedDetailsReader.read_one(reader)) 6094 6095 # Discard the end tag: 6096 reader.read() 6097 6098 return objs 6099 6100 @staticmethod 6101 def _process_link(link, obj): 6102 # Process the attributes: 6103 rel = link[0] 6104 href = link[1] 6105 if href and rel: 6106 if rel == "vms": 6107 if obj.vms is not None: 6108 obj.vms.href = href 6109 else: 6110 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6009 @staticmethod 6010 def read_one(reader): 6011 # Do nothing if there aren't more tags: 6012 if not reader.forward(): 6013 return None 6014 6015 # Create the object: 6016 obj = types.GlusterBrickAdvancedDetails() 6017 6018 # Process the attributes: 6019 obj.href = reader.get_attribute('href') 6020 value = reader.get_attribute('id') 6021 if value is not None: 6022 obj.id = value 6023 6024 # Discard the start tag: 6025 empty = reader.empty_element() 6026 reader.read() 6027 if empty: 6028 return obj 6029 6030 # Process the inner elements: 6031 links = [] 6032 while reader.forward(): 6033 tag = reader.node_name() 6034 if tag == 'comment': 6035 obj.comment = Reader.read_string(reader) 6036 elif tag == 'description': 6037 obj.description = Reader.read_string(reader) 6038 elif tag == 'device': 6039 obj.device = Reader.read_string(reader) 6040 elif tag == 'fs_name': 6041 obj.fs_name = Reader.read_string(reader) 6042 elif tag == 'gluster_clients': 6043 obj.gluster_clients = GlusterClientReader.read_many(reader) 6044 elif tag == 'instance_type': 6045 obj.instance_type = InstanceTypeReader.read_one(reader) 6046 elif tag == 'memory_pools': 6047 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6048 elif tag == 'mnt_options': 6049 obj.mnt_options = Reader.read_string(reader) 6050 elif tag == 'name': 6051 obj.name = Reader.read_string(reader) 6052 elif tag == 'pid': 6053 obj.pid = Reader.read_integer(reader) 6054 elif tag == 'port': 6055 obj.port = Reader.read_integer(reader) 6056 elif tag == 'template': 6057 obj.template = TemplateReader.read_one(reader) 6058 elif tag == 'vm': 6059 obj.vm = VmReader.read_one(reader) 6060 elif tag == 'vms': 6061 obj.vms = VmReader.read_many(reader) 6062 elif tag == 'link': 6063 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6064 reader.next_element() 6065 else: 6066 reader.next_element() 6067 for link in links: 6068 GlusterBrickAdvancedDetailsReader._process_link(link, obj) 6069 6070 # Discard the end tag: 6071 reader.read() 6072 6073 return obj
6075 @staticmethod 6076 def read_many(reader): 6077 # Do nothing if there aren't more tags: 6078 objs = List() 6079 if not reader.forward(): 6080 return objs 6081 6082 # Process the attributes: 6083 objs.href = reader.get_attribute('href') 6084 6085 # Discard the start tag: 6086 empty = reader.empty_element() 6087 reader.read() 6088 if empty: 6089 return objs 6090 6091 # Process the inner elements: 6092 while reader.forward(): 6093 objs.append(GlusterBrickAdvancedDetailsReader.read_one(reader)) 6094 6095 # Discard the end tag: 6096 reader.read() 6097 6098 return objs
6113class GlusterBrickMemoryInfoReader(Reader): 6114 6115 def __init__(self): 6116 super(GlusterBrickMemoryInfoReader, self).__init__() 6117 6118 @staticmethod 6119 def read_one(reader): 6120 # Do nothing if there aren't more tags: 6121 if not reader.forward(): 6122 return None 6123 6124 # Create the object: 6125 obj = types.GlusterBrickMemoryInfo() 6126 6127 # Process the attributes: 6128 obj.href = reader.get_attribute('href') 6129 6130 # Discard the start tag: 6131 empty = reader.empty_element() 6132 reader.read() 6133 if empty: 6134 return obj 6135 6136 # Process the inner elements: 6137 links = [] 6138 while reader.forward(): 6139 tag = reader.node_name() 6140 if tag == 'memory_pools': 6141 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6142 else: 6143 reader.next_element() 6144 for link in links: 6145 GlusterBrickMemoryInfoReader._process_link(link, obj) 6146 6147 # Discard the end tag: 6148 reader.read() 6149 6150 return obj 6151 6152 @staticmethod 6153 def read_many(reader): 6154 # Do nothing if there aren't more tags: 6155 objs = List() 6156 if not reader.forward(): 6157 return objs 6158 6159 # Process the attributes: 6160 objs.href = reader.get_attribute('href') 6161 6162 # Discard the start tag: 6163 empty = reader.empty_element() 6164 reader.read() 6165 if empty: 6166 return objs 6167 6168 # Process the inner elements: 6169 while reader.forward(): 6170 objs.append(GlusterBrickMemoryInfoReader.read_one(reader)) 6171 6172 # Discard the end tag: 6173 reader.read() 6174 6175 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6118 @staticmethod 6119 def read_one(reader): 6120 # Do nothing if there aren't more tags: 6121 if not reader.forward(): 6122 return None 6123 6124 # Create the object: 6125 obj = types.GlusterBrickMemoryInfo() 6126 6127 # Process the attributes: 6128 obj.href = reader.get_attribute('href') 6129 6130 # Discard the start tag: 6131 empty = reader.empty_element() 6132 reader.read() 6133 if empty: 6134 return obj 6135 6136 # Process the inner elements: 6137 links = [] 6138 while reader.forward(): 6139 tag = reader.node_name() 6140 if tag == 'memory_pools': 6141 obj.memory_pools = GlusterMemoryPoolReader.read_many(reader) 6142 else: 6143 reader.next_element() 6144 for link in links: 6145 GlusterBrickMemoryInfoReader._process_link(link, obj) 6146 6147 # Discard the end tag: 6148 reader.read() 6149 6150 return obj
6152 @staticmethod 6153 def read_many(reader): 6154 # Do nothing if there aren't more tags: 6155 objs = List() 6156 if not reader.forward(): 6157 return objs 6158 6159 # Process the attributes: 6160 objs.href = reader.get_attribute('href') 6161 6162 # Discard the start tag: 6163 empty = reader.empty_element() 6164 reader.read() 6165 if empty: 6166 return objs 6167 6168 # Process the inner elements: 6169 while reader.forward(): 6170 objs.append(GlusterBrickMemoryInfoReader.read_one(reader)) 6171 6172 # Discard the end tag: 6173 reader.read() 6174 6175 return objs
6178class GlusterClientReader(Reader): 6179 6180 def __init__(self): 6181 super(GlusterClientReader, self).__init__() 6182 6183 @staticmethod 6184 def read_one(reader): 6185 # Do nothing if there aren't more tags: 6186 if not reader.forward(): 6187 return None 6188 6189 # Create the object: 6190 obj = types.GlusterClient() 6191 6192 # Process the attributes: 6193 obj.href = reader.get_attribute('href') 6194 6195 # Discard the start tag: 6196 empty = reader.empty_element() 6197 reader.read() 6198 if empty: 6199 return obj 6200 6201 # Process the inner elements: 6202 links = [] 6203 while reader.forward(): 6204 tag = reader.node_name() 6205 if tag == 'bytes_read': 6206 obj.bytes_read = Reader.read_integer(reader) 6207 elif tag == 'bytes_written': 6208 obj.bytes_written = Reader.read_integer(reader) 6209 elif tag == 'client_port': 6210 obj.client_port = Reader.read_integer(reader) 6211 elif tag == 'host_name': 6212 obj.host_name = Reader.read_string(reader) 6213 else: 6214 reader.next_element() 6215 for link in links: 6216 GlusterClientReader._process_link(link, obj) 6217 6218 # Discard the end tag: 6219 reader.read() 6220 6221 return obj 6222 6223 @staticmethod 6224 def read_many(reader): 6225 # Do nothing if there aren't more tags: 6226 objs = List() 6227 if not reader.forward(): 6228 return objs 6229 6230 # Process the attributes: 6231 objs.href = reader.get_attribute('href') 6232 6233 # Discard the start tag: 6234 empty = reader.empty_element() 6235 reader.read() 6236 if empty: 6237 return objs 6238 6239 # Process the inner elements: 6240 while reader.forward(): 6241 objs.append(GlusterClientReader.read_one(reader)) 6242 6243 # Discard the end tag: 6244 reader.read() 6245 6246 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6183 @staticmethod 6184 def read_one(reader): 6185 # Do nothing if there aren't more tags: 6186 if not reader.forward(): 6187 return None 6188 6189 # Create the object: 6190 obj = types.GlusterClient() 6191 6192 # Process the attributes: 6193 obj.href = reader.get_attribute('href') 6194 6195 # Discard the start tag: 6196 empty = reader.empty_element() 6197 reader.read() 6198 if empty: 6199 return obj 6200 6201 # Process the inner elements: 6202 links = [] 6203 while reader.forward(): 6204 tag = reader.node_name() 6205 if tag == 'bytes_read': 6206 obj.bytes_read = Reader.read_integer(reader) 6207 elif tag == 'bytes_written': 6208 obj.bytes_written = Reader.read_integer(reader) 6209 elif tag == 'client_port': 6210 obj.client_port = Reader.read_integer(reader) 6211 elif tag == 'host_name': 6212 obj.host_name = Reader.read_string(reader) 6213 else: 6214 reader.next_element() 6215 for link in links: 6216 GlusterClientReader._process_link(link, obj) 6217 6218 # Discard the end tag: 6219 reader.read() 6220 6221 return obj
6223 @staticmethod 6224 def read_many(reader): 6225 # Do nothing if there aren't more tags: 6226 objs = List() 6227 if not reader.forward(): 6228 return objs 6229 6230 # Process the attributes: 6231 objs.href = reader.get_attribute('href') 6232 6233 # Discard the start tag: 6234 empty = reader.empty_element() 6235 reader.read() 6236 if empty: 6237 return objs 6238 6239 # Process the inner elements: 6240 while reader.forward(): 6241 objs.append(GlusterClientReader.read_one(reader)) 6242 6243 # Discard the end tag: 6244 reader.read() 6245 6246 return objs
6249class GlusterHookReader(Reader): 6250 6251 def __init__(self): 6252 super(GlusterHookReader, self).__init__() 6253 6254 @staticmethod 6255 def read_one(reader): 6256 # Do nothing if there aren't more tags: 6257 if not reader.forward(): 6258 return None 6259 6260 # Create the object: 6261 obj = types.GlusterHook() 6262 6263 # Process the attributes: 6264 obj.href = reader.get_attribute('href') 6265 value = reader.get_attribute('id') 6266 if value is not None: 6267 obj.id = value 6268 6269 # Discard the start tag: 6270 empty = reader.empty_element() 6271 reader.read() 6272 if empty: 6273 return obj 6274 6275 # Process the inner elements: 6276 links = [] 6277 while reader.forward(): 6278 tag = reader.node_name() 6279 if tag == 'checksum': 6280 obj.checksum = Reader.read_string(reader) 6281 elif tag == 'cluster': 6282 obj.cluster = ClusterReader.read_one(reader) 6283 elif tag == 'comment': 6284 obj.comment = Reader.read_string(reader) 6285 elif tag == 'conflict_status': 6286 obj.conflict_status = Reader.read_integer(reader) 6287 elif tag == 'conflicts': 6288 obj.conflicts = Reader.read_string(reader) 6289 elif tag == 'content': 6290 obj.content = Reader.read_string(reader) 6291 elif tag == 'content_type': 6292 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6293 elif tag == 'description': 6294 obj.description = Reader.read_string(reader) 6295 elif tag == 'gluster_command': 6296 obj.gluster_command = Reader.read_string(reader) 6297 elif tag == 'name': 6298 obj.name = Reader.read_string(reader) 6299 elif tag == 'server_hooks': 6300 obj.server_hooks = GlusterServerHookReader.read_many(reader) 6301 elif tag == 'stage': 6302 obj.stage = Reader.read_enum(types.HookStage, reader) 6303 elif tag == 'status': 6304 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6305 elif tag == 'link': 6306 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6307 reader.next_element() 6308 else: 6309 reader.next_element() 6310 for link in links: 6311 GlusterHookReader._process_link(link, obj) 6312 6313 # Discard the end tag: 6314 reader.read() 6315 6316 return obj 6317 6318 @staticmethod 6319 def read_many(reader): 6320 # Do nothing if there aren't more tags: 6321 objs = List() 6322 if not reader.forward(): 6323 return objs 6324 6325 # Process the attributes: 6326 objs.href = reader.get_attribute('href') 6327 6328 # Discard the start tag: 6329 empty = reader.empty_element() 6330 reader.read() 6331 if empty: 6332 return objs 6333 6334 # Process the inner elements: 6335 while reader.forward(): 6336 objs.append(GlusterHookReader.read_one(reader)) 6337 6338 # Discard the end tag: 6339 reader.read() 6340 6341 return objs 6342 6343 @staticmethod 6344 def _process_link(link, obj): 6345 # Process the attributes: 6346 rel = link[0] 6347 href = link[1] 6348 if href and rel: 6349 if rel == "serverhooks": 6350 if obj.server_hooks is not None: 6351 obj.server_hooks.href = href 6352 else: 6353 obj.server_hooks = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6254 @staticmethod 6255 def read_one(reader): 6256 # Do nothing if there aren't more tags: 6257 if not reader.forward(): 6258 return None 6259 6260 # Create the object: 6261 obj = types.GlusterHook() 6262 6263 # Process the attributes: 6264 obj.href = reader.get_attribute('href') 6265 value = reader.get_attribute('id') 6266 if value is not None: 6267 obj.id = value 6268 6269 # Discard the start tag: 6270 empty = reader.empty_element() 6271 reader.read() 6272 if empty: 6273 return obj 6274 6275 # Process the inner elements: 6276 links = [] 6277 while reader.forward(): 6278 tag = reader.node_name() 6279 if tag == 'checksum': 6280 obj.checksum = Reader.read_string(reader) 6281 elif tag == 'cluster': 6282 obj.cluster = ClusterReader.read_one(reader) 6283 elif tag == 'comment': 6284 obj.comment = Reader.read_string(reader) 6285 elif tag == 'conflict_status': 6286 obj.conflict_status = Reader.read_integer(reader) 6287 elif tag == 'conflicts': 6288 obj.conflicts = Reader.read_string(reader) 6289 elif tag == 'content': 6290 obj.content = Reader.read_string(reader) 6291 elif tag == 'content_type': 6292 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6293 elif tag == 'description': 6294 obj.description = Reader.read_string(reader) 6295 elif tag == 'gluster_command': 6296 obj.gluster_command = Reader.read_string(reader) 6297 elif tag == 'name': 6298 obj.name = Reader.read_string(reader) 6299 elif tag == 'server_hooks': 6300 obj.server_hooks = GlusterServerHookReader.read_many(reader) 6301 elif tag == 'stage': 6302 obj.stage = Reader.read_enum(types.HookStage, reader) 6303 elif tag == 'status': 6304 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6305 elif tag == 'link': 6306 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6307 reader.next_element() 6308 else: 6309 reader.next_element() 6310 for link in links: 6311 GlusterHookReader._process_link(link, obj) 6312 6313 # Discard the end tag: 6314 reader.read() 6315 6316 return obj
6318 @staticmethod 6319 def read_many(reader): 6320 # Do nothing if there aren't more tags: 6321 objs = List() 6322 if not reader.forward(): 6323 return objs 6324 6325 # Process the attributes: 6326 objs.href = reader.get_attribute('href') 6327 6328 # Discard the start tag: 6329 empty = reader.empty_element() 6330 reader.read() 6331 if empty: 6332 return objs 6333 6334 # Process the inner elements: 6335 while reader.forward(): 6336 objs.append(GlusterHookReader.read_one(reader)) 6337 6338 # Discard the end tag: 6339 reader.read() 6340 6341 return objs
6356class GlusterMemoryPoolReader(Reader): 6357 6358 def __init__(self): 6359 super(GlusterMemoryPoolReader, self).__init__() 6360 6361 @staticmethod 6362 def read_one(reader): 6363 # Do nothing if there aren't more tags: 6364 if not reader.forward(): 6365 return None 6366 6367 # Create the object: 6368 obj = types.GlusterMemoryPool() 6369 6370 # Process the attributes: 6371 obj.href = reader.get_attribute('href') 6372 value = reader.get_attribute('id') 6373 if value is not None: 6374 obj.id = value 6375 6376 # Discard the start tag: 6377 empty = reader.empty_element() 6378 reader.read() 6379 if empty: 6380 return obj 6381 6382 # Process the inner elements: 6383 links = [] 6384 while reader.forward(): 6385 tag = reader.node_name() 6386 if tag == 'alloc_count': 6387 obj.alloc_count = Reader.read_integer(reader) 6388 elif tag == 'cold_count': 6389 obj.cold_count = Reader.read_integer(reader) 6390 elif tag == 'comment': 6391 obj.comment = Reader.read_string(reader) 6392 elif tag == 'description': 6393 obj.description = Reader.read_string(reader) 6394 elif tag == 'hot_count': 6395 obj.hot_count = Reader.read_integer(reader) 6396 elif tag == 'max_alloc': 6397 obj.max_alloc = Reader.read_integer(reader) 6398 elif tag == 'max_stdalloc': 6399 obj.max_stdalloc = Reader.read_integer(reader) 6400 elif tag == 'name': 6401 obj.name = Reader.read_string(reader) 6402 elif tag == 'padded_size': 6403 obj.padded_size = Reader.read_integer(reader) 6404 elif tag == 'pool_misses': 6405 obj.pool_misses = Reader.read_integer(reader) 6406 elif tag == 'type': 6407 obj.type = Reader.read_string(reader) 6408 else: 6409 reader.next_element() 6410 for link in links: 6411 GlusterMemoryPoolReader._process_link(link, obj) 6412 6413 # Discard the end tag: 6414 reader.read() 6415 6416 return obj 6417 6418 @staticmethod 6419 def read_many(reader): 6420 # Do nothing if there aren't more tags: 6421 objs = List() 6422 if not reader.forward(): 6423 return objs 6424 6425 # Process the attributes: 6426 objs.href = reader.get_attribute('href') 6427 6428 # Discard the start tag: 6429 empty = reader.empty_element() 6430 reader.read() 6431 if empty: 6432 return objs 6433 6434 # Process the inner elements: 6435 while reader.forward(): 6436 objs.append(GlusterMemoryPoolReader.read_one(reader)) 6437 6438 # Discard the end tag: 6439 reader.read() 6440 6441 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6361 @staticmethod 6362 def read_one(reader): 6363 # Do nothing if there aren't more tags: 6364 if not reader.forward(): 6365 return None 6366 6367 # Create the object: 6368 obj = types.GlusterMemoryPool() 6369 6370 # Process the attributes: 6371 obj.href = reader.get_attribute('href') 6372 value = reader.get_attribute('id') 6373 if value is not None: 6374 obj.id = value 6375 6376 # Discard the start tag: 6377 empty = reader.empty_element() 6378 reader.read() 6379 if empty: 6380 return obj 6381 6382 # Process the inner elements: 6383 links = [] 6384 while reader.forward(): 6385 tag = reader.node_name() 6386 if tag == 'alloc_count': 6387 obj.alloc_count = Reader.read_integer(reader) 6388 elif tag == 'cold_count': 6389 obj.cold_count = Reader.read_integer(reader) 6390 elif tag == 'comment': 6391 obj.comment = Reader.read_string(reader) 6392 elif tag == 'description': 6393 obj.description = Reader.read_string(reader) 6394 elif tag == 'hot_count': 6395 obj.hot_count = Reader.read_integer(reader) 6396 elif tag == 'max_alloc': 6397 obj.max_alloc = Reader.read_integer(reader) 6398 elif tag == 'max_stdalloc': 6399 obj.max_stdalloc = Reader.read_integer(reader) 6400 elif tag == 'name': 6401 obj.name = Reader.read_string(reader) 6402 elif tag == 'padded_size': 6403 obj.padded_size = Reader.read_integer(reader) 6404 elif tag == 'pool_misses': 6405 obj.pool_misses = Reader.read_integer(reader) 6406 elif tag == 'type': 6407 obj.type = Reader.read_string(reader) 6408 else: 6409 reader.next_element() 6410 for link in links: 6411 GlusterMemoryPoolReader._process_link(link, obj) 6412 6413 # Discard the end tag: 6414 reader.read() 6415 6416 return obj
6418 @staticmethod 6419 def read_many(reader): 6420 # Do nothing if there aren't more tags: 6421 objs = List() 6422 if not reader.forward(): 6423 return objs 6424 6425 # Process the attributes: 6426 objs.href = reader.get_attribute('href') 6427 6428 # Discard the start tag: 6429 empty = reader.empty_element() 6430 reader.read() 6431 if empty: 6432 return objs 6433 6434 # Process the inner elements: 6435 while reader.forward(): 6436 objs.append(GlusterMemoryPoolReader.read_one(reader)) 6437 6438 # Discard the end tag: 6439 reader.read() 6440 6441 return objs
6444class GlusterServerHookReader(Reader): 6445 6446 def __init__(self): 6447 super(GlusterServerHookReader, self).__init__() 6448 6449 @staticmethod 6450 def read_one(reader): 6451 # Do nothing if there aren't more tags: 6452 if not reader.forward(): 6453 return None 6454 6455 # Create the object: 6456 obj = types.GlusterServerHook() 6457 6458 # Process the attributes: 6459 obj.href = reader.get_attribute('href') 6460 value = reader.get_attribute('id') 6461 if value is not None: 6462 obj.id = value 6463 6464 # Discard the start tag: 6465 empty = reader.empty_element() 6466 reader.read() 6467 if empty: 6468 return obj 6469 6470 # Process the inner elements: 6471 links = [] 6472 while reader.forward(): 6473 tag = reader.node_name() 6474 if tag == 'checksum': 6475 obj.checksum = Reader.read_string(reader) 6476 elif tag == 'comment': 6477 obj.comment = Reader.read_string(reader) 6478 elif tag == 'content_type': 6479 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6480 elif tag == 'description': 6481 obj.description = Reader.read_string(reader) 6482 elif tag == 'host': 6483 obj.host = HostReader.read_one(reader) 6484 elif tag == 'name': 6485 obj.name = Reader.read_string(reader) 6486 elif tag == 'status': 6487 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6488 else: 6489 reader.next_element() 6490 for link in links: 6491 GlusterServerHookReader._process_link(link, obj) 6492 6493 # Discard the end tag: 6494 reader.read() 6495 6496 return obj 6497 6498 @staticmethod 6499 def read_many(reader): 6500 # Do nothing if there aren't more tags: 6501 objs = List() 6502 if not reader.forward(): 6503 return objs 6504 6505 # Process the attributes: 6506 objs.href = reader.get_attribute('href') 6507 6508 # Discard the start tag: 6509 empty = reader.empty_element() 6510 reader.read() 6511 if empty: 6512 return objs 6513 6514 # Process the inner elements: 6515 while reader.forward(): 6516 objs.append(GlusterServerHookReader.read_one(reader)) 6517 6518 # Discard the end tag: 6519 reader.read() 6520 6521 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6449 @staticmethod 6450 def read_one(reader): 6451 # Do nothing if there aren't more tags: 6452 if not reader.forward(): 6453 return None 6454 6455 # Create the object: 6456 obj = types.GlusterServerHook() 6457 6458 # Process the attributes: 6459 obj.href = reader.get_attribute('href') 6460 value = reader.get_attribute('id') 6461 if value is not None: 6462 obj.id = value 6463 6464 # Discard the start tag: 6465 empty = reader.empty_element() 6466 reader.read() 6467 if empty: 6468 return obj 6469 6470 # Process the inner elements: 6471 links = [] 6472 while reader.forward(): 6473 tag = reader.node_name() 6474 if tag == 'checksum': 6475 obj.checksum = Reader.read_string(reader) 6476 elif tag == 'comment': 6477 obj.comment = Reader.read_string(reader) 6478 elif tag == 'content_type': 6479 obj.content_type = Reader.read_enum(types.HookContentType, reader) 6480 elif tag == 'description': 6481 obj.description = Reader.read_string(reader) 6482 elif tag == 'host': 6483 obj.host = HostReader.read_one(reader) 6484 elif tag == 'name': 6485 obj.name = Reader.read_string(reader) 6486 elif tag == 'status': 6487 obj.status = Reader.read_enum(types.GlusterHookStatus, reader) 6488 else: 6489 reader.next_element() 6490 for link in links: 6491 GlusterServerHookReader._process_link(link, obj) 6492 6493 # Discard the end tag: 6494 reader.read() 6495 6496 return obj
6498 @staticmethod 6499 def read_many(reader): 6500 # Do nothing if there aren't more tags: 6501 objs = List() 6502 if not reader.forward(): 6503 return objs 6504 6505 # Process the attributes: 6506 objs.href = reader.get_attribute('href') 6507 6508 # Discard the start tag: 6509 empty = reader.empty_element() 6510 reader.read() 6511 if empty: 6512 return objs 6513 6514 # Process the inner elements: 6515 while reader.forward(): 6516 objs.append(GlusterServerHookReader.read_one(reader)) 6517 6518 # Discard the end tag: 6519 reader.read() 6520 6521 return objs
6524class GlusterVolumeReader(Reader): 6525 6526 def __init__(self): 6527 super(GlusterVolumeReader, self).__init__() 6528 6529 @staticmethod 6530 def read_one(reader): 6531 # Do nothing if there aren't more tags: 6532 if not reader.forward(): 6533 return None 6534 6535 # Create the object: 6536 obj = types.GlusterVolume() 6537 6538 # Process the attributes: 6539 obj.href = reader.get_attribute('href') 6540 value = reader.get_attribute('id') 6541 if value is not None: 6542 obj.id = value 6543 6544 # Discard the start tag: 6545 empty = reader.empty_element() 6546 reader.read() 6547 if empty: 6548 return obj 6549 6550 # Process the inner elements: 6551 links = [] 6552 while reader.forward(): 6553 tag = reader.node_name() 6554 if tag == 'bricks': 6555 obj.bricks = GlusterBrickReader.read_many(reader) 6556 elif tag == 'cluster': 6557 obj.cluster = ClusterReader.read_one(reader) 6558 elif tag == 'comment': 6559 obj.comment = Reader.read_string(reader) 6560 elif tag == 'description': 6561 obj.description = Reader.read_string(reader) 6562 elif tag == 'disperse_count': 6563 obj.disperse_count = Reader.read_integer(reader) 6564 elif tag == 'name': 6565 obj.name = Reader.read_string(reader) 6566 elif tag == 'options': 6567 obj.options = OptionReader.read_many(reader) 6568 elif tag == 'redundancy_count': 6569 obj.redundancy_count = Reader.read_integer(reader) 6570 elif tag == 'replica_count': 6571 obj.replica_count = Reader.read_integer(reader) 6572 elif tag == 'statistics': 6573 obj.statistics = StatisticReader.read_many(reader) 6574 elif tag == 'status': 6575 obj.status = Reader.read_enum(types.GlusterVolumeStatus, reader) 6576 elif tag == 'stripe_count': 6577 obj.stripe_count = Reader.read_integer(reader) 6578 elif tag == 'transport_types': 6579 obj.transport_types = Reader.read_enums(types.TransportType, reader) 6580 elif tag == 'volume_type': 6581 obj.volume_type = Reader.read_enum(types.GlusterVolumeType, reader) 6582 elif tag == 'link': 6583 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6584 reader.next_element() 6585 else: 6586 reader.next_element() 6587 for link in links: 6588 GlusterVolumeReader._process_link(link, obj) 6589 6590 # Discard the end tag: 6591 reader.read() 6592 6593 return obj 6594 6595 @staticmethod 6596 def read_many(reader): 6597 # Do nothing if there aren't more tags: 6598 objs = List() 6599 if not reader.forward(): 6600 return objs 6601 6602 # Process the attributes: 6603 objs.href = reader.get_attribute('href') 6604 6605 # Discard the start tag: 6606 empty = reader.empty_element() 6607 reader.read() 6608 if empty: 6609 return objs 6610 6611 # Process the inner elements: 6612 while reader.forward(): 6613 objs.append(GlusterVolumeReader.read_one(reader)) 6614 6615 # Discard the end tag: 6616 reader.read() 6617 6618 return objs 6619 6620 @staticmethod 6621 def _process_link(link, obj): 6622 # Process the attributes: 6623 rel = link[0] 6624 href = link[1] 6625 if href and rel: 6626 if rel == "bricks": 6627 if obj.bricks is not None: 6628 obj.bricks.href = href 6629 else: 6630 obj.bricks = List(href) 6631 elif rel == "statistics": 6632 if obj.statistics is not None: 6633 obj.statistics.href = href 6634 else: 6635 obj.statistics = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6529 @staticmethod 6530 def read_one(reader): 6531 # Do nothing if there aren't more tags: 6532 if not reader.forward(): 6533 return None 6534 6535 # Create the object: 6536 obj = types.GlusterVolume() 6537 6538 # Process the attributes: 6539 obj.href = reader.get_attribute('href') 6540 value = reader.get_attribute('id') 6541 if value is not None: 6542 obj.id = value 6543 6544 # Discard the start tag: 6545 empty = reader.empty_element() 6546 reader.read() 6547 if empty: 6548 return obj 6549 6550 # Process the inner elements: 6551 links = [] 6552 while reader.forward(): 6553 tag = reader.node_name() 6554 if tag == 'bricks': 6555 obj.bricks = GlusterBrickReader.read_many(reader) 6556 elif tag == 'cluster': 6557 obj.cluster = ClusterReader.read_one(reader) 6558 elif tag == 'comment': 6559 obj.comment = Reader.read_string(reader) 6560 elif tag == 'description': 6561 obj.description = Reader.read_string(reader) 6562 elif tag == 'disperse_count': 6563 obj.disperse_count = Reader.read_integer(reader) 6564 elif tag == 'name': 6565 obj.name = Reader.read_string(reader) 6566 elif tag == 'options': 6567 obj.options = OptionReader.read_many(reader) 6568 elif tag == 'redundancy_count': 6569 obj.redundancy_count = Reader.read_integer(reader) 6570 elif tag == 'replica_count': 6571 obj.replica_count = Reader.read_integer(reader) 6572 elif tag == 'statistics': 6573 obj.statistics = StatisticReader.read_many(reader) 6574 elif tag == 'status': 6575 obj.status = Reader.read_enum(types.GlusterVolumeStatus, reader) 6576 elif tag == 'stripe_count': 6577 obj.stripe_count = Reader.read_integer(reader) 6578 elif tag == 'transport_types': 6579 obj.transport_types = Reader.read_enums(types.TransportType, reader) 6580 elif tag == 'volume_type': 6581 obj.volume_type = Reader.read_enum(types.GlusterVolumeType, reader) 6582 elif tag == 'link': 6583 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6584 reader.next_element() 6585 else: 6586 reader.next_element() 6587 for link in links: 6588 GlusterVolumeReader._process_link(link, obj) 6589 6590 # Discard the end tag: 6591 reader.read() 6592 6593 return obj
6595 @staticmethod 6596 def read_many(reader): 6597 # Do nothing if there aren't more tags: 6598 objs = List() 6599 if not reader.forward(): 6600 return objs 6601 6602 # Process the attributes: 6603 objs.href = reader.get_attribute('href') 6604 6605 # Discard the start tag: 6606 empty = reader.empty_element() 6607 reader.read() 6608 if empty: 6609 return objs 6610 6611 # Process the inner elements: 6612 while reader.forward(): 6613 objs.append(GlusterVolumeReader.read_one(reader)) 6614 6615 # Discard the end tag: 6616 reader.read() 6617 6618 return objs
6638class GlusterVolumeProfileDetailsReader(Reader): 6639 6640 def __init__(self): 6641 super(GlusterVolumeProfileDetailsReader, self).__init__() 6642 6643 @staticmethod 6644 def read_one(reader): 6645 # Do nothing if there aren't more tags: 6646 if not reader.forward(): 6647 return None 6648 6649 # Create the object: 6650 obj = types.GlusterVolumeProfileDetails() 6651 6652 # Process the attributes: 6653 obj.href = reader.get_attribute('href') 6654 value = reader.get_attribute('id') 6655 if value is not None: 6656 obj.id = value 6657 6658 # Discard the start tag: 6659 empty = reader.empty_element() 6660 reader.read() 6661 if empty: 6662 return obj 6663 6664 # Process the inner elements: 6665 links = [] 6666 while reader.forward(): 6667 tag = reader.node_name() 6668 if tag == 'brick_profile_details': 6669 obj.brick_profile_details = BrickProfileDetailReader.read_many(reader) 6670 elif tag == 'comment': 6671 obj.comment = Reader.read_string(reader) 6672 elif tag == 'description': 6673 obj.description = Reader.read_string(reader) 6674 elif tag == 'name': 6675 obj.name = Reader.read_string(reader) 6676 elif tag == 'nfs_profile_details': 6677 obj.nfs_profile_details = NfsProfileDetailReader.read_many(reader) 6678 else: 6679 reader.next_element() 6680 for link in links: 6681 GlusterVolumeProfileDetailsReader._process_link(link, obj) 6682 6683 # Discard the end tag: 6684 reader.read() 6685 6686 return obj 6687 6688 @staticmethod 6689 def read_many(reader): 6690 # Do nothing if there aren't more tags: 6691 objs = List() 6692 if not reader.forward(): 6693 return objs 6694 6695 # Process the attributes: 6696 objs.href = reader.get_attribute('href') 6697 6698 # Discard the start tag: 6699 empty = reader.empty_element() 6700 reader.read() 6701 if empty: 6702 return objs 6703 6704 # Process the inner elements: 6705 while reader.forward(): 6706 objs.append(GlusterVolumeProfileDetailsReader.read_one(reader)) 6707 6708 # Discard the end tag: 6709 reader.read() 6710 6711 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6643 @staticmethod 6644 def read_one(reader): 6645 # Do nothing if there aren't more tags: 6646 if not reader.forward(): 6647 return None 6648 6649 # Create the object: 6650 obj = types.GlusterVolumeProfileDetails() 6651 6652 # Process the attributes: 6653 obj.href = reader.get_attribute('href') 6654 value = reader.get_attribute('id') 6655 if value is not None: 6656 obj.id = value 6657 6658 # Discard the start tag: 6659 empty = reader.empty_element() 6660 reader.read() 6661 if empty: 6662 return obj 6663 6664 # Process the inner elements: 6665 links = [] 6666 while reader.forward(): 6667 tag = reader.node_name() 6668 if tag == 'brick_profile_details': 6669 obj.brick_profile_details = BrickProfileDetailReader.read_many(reader) 6670 elif tag == 'comment': 6671 obj.comment = Reader.read_string(reader) 6672 elif tag == 'description': 6673 obj.description = Reader.read_string(reader) 6674 elif tag == 'name': 6675 obj.name = Reader.read_string(reader) 6676 elif tag == 'nfs_profile_details': 6677 obj.nfs_profile_details = NfsProfileDetailReader.read_many(reader) 6678 else: 6679 reader.next_element() 6680 for link in links: 6681 GlusterVolumeProfileDetailsReader._process_link(link, obj) 6682 6683 # Discard the end tag: 6684 reader.read() 6685 6686 return obj
6688 @staticmethod 6689 def read_many(reader): 6690 # Do nothing if there aren't more tags: 6691 objs = List() 6692 if not reader.forward(): 6693 return objs 6694 6695 # Process the attributes: 6696 objs.href = reader.get_attribute('href') 6697 6698 # Discard the start tag: 6699 empty = reader.empty_element() 6700 reader.read() 6701 if empty: 6702 return objs 6703 6704 # Process the inner elements: 6705 while reader.forward(): 6706 objs.append(GlusterVolumeProfileDetailsReader.read_one(reader)) 6707 6708 # Discard the end tag: 6709 reader.read() 6710 6711 return objs
6714class GracePeriodReader(Reader): 6715 6716 def __init__(self): 6717 super(GracePeriodReader, self).__init__() 6718 6719 @staticmethod 6720 def read_one(reader): 6721 # Do nothing if there aren't more tags: 6722 if not reader.forward(): 6723 return None 6724 6725 # Create the object: 6726 obj = types.GracePeriod() 6727 6728 # Process the attributes: 6729 obj.href = reader.get_attribute('href') 6730 6731 # Discard the start tag: 6732 empty = reader.empty_element() 6733 reader.read() 6734 if empty: 6735 return obj 6736 6737 # Process the inner elements: 6738 links = [] 6739 while reader.forward(): 6740 tag = reader.node_name() 6741 if tag == 'expiry': 6742 obj.expiry = Reader.read_integer(reader) 6743 else: 6744 reader.next_element() 6745 for link in links: 6746 GracePeriodReader._process_link(link, obj) 6747 6748 # Discard the end tag: 6749 reader.read() 6750 6751 return obj 6752 6753 @staticmethod 6754 def read_many(reader): 6755 # Do nothing if there aren't more tags: 6756 objs = List() 6757 if not reader.forward(): 6758 return objs 6759 6760 # Process the attributes: 6761 objs.href = reader.get_attribute('href') 6762 6763 # Discard the start tag: 6764 empty = reader.empty_element() 6765 reader.read() 6766 if empty: 6767 return objs 6768 6769 # Process the inner elements: 6770 while reader.forward(): 6771 objs.append(GracePeriodReader.read_one(reader)) 6772 6773 # Discard the end tag: 6774 reader.read() 6775 6776 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6719 @staticmethod 6720 def read_one(reader): 6721 # Do nothing if there aren't more tags: 6722 if not reader.forward(): 6723 return None 6724 6725 # Create the object: 6726 obj = types.GracePeriod() 6727 6728 # Process the attributes: 6729 obj.href = reader.get_attribute('href') 6730 6731 # Discard the start tag: 6732 empty = reader.empty_element() 6733 reader.read() 6734 if empty: 6735 return obj 6736 6737 # Process the inner elements: 6738 links = [] 6739 while reader.forward(): 6740 tag = reader.node_name() 6741 if tag == 'expiry': 6742 obj.expiry = Reader.read_integer(reader) 6743 else: 6744 reader.next_element() 6745 for link in links: 6746 GracePeriodReader._process_link(link, obj) 6747 6748 # Discard the end tag: 6749 reader.read() 6750 6751 return obj
6753 @staticmethod 6754 def read_many(reader): 6755 # Do nothing if there aren't more tags: 6756 objs = List() 6757 if not reader.forward(): 6758 return objs 6759 6760 # Process the attributes: 6761 objs.href = reader.get_attribute('href') 6762 6763 # Discard the start tag: 6764 empty = reader.empty_element() 6765 reader.read() 6766 if empty: 6767 return objs 6768 6769 # Process the inner elements: 6770 while reader.forward(): 6771 objs.append(GracePeriodReader.read_one(reader)) 6772 6773 # Discard the end tag: 6774 reader.read() 6775 6776 return objs
6779class GraphicsConsoleReader(Reader): 6780 6781 def __init__(self): 6782 super(GraphicsConsoleReader, self).__init__() 6783 6784 @staticmethod 6785 def read_one(reader): 6786 # Do nothing if there aren't more tags: 6787 if not reader.forward(): 6788 return None 6789 6790 # Create the object: 6791 obj = types.GraphicsConsole() 6792 6793 # Process the attributes: 6794 obj.href = reader.get_attribute('href') 6795 value = reader.get_attribute('id') 6796 if value is not None: 6797 obj.id = value 6798 6799 # Discard the start tag: 6800 empty = reader.empty_element() 6801 reader.read() 6802 if empty: 6803 return obj 6804 6805 # Process the inner elements: 6806 links = [] 6807 while reader.forward(): 6808 tag = reader.node_name() 6809 if tag == 'address': 6810 obj.address = Reader.read_string(reader) 6811 elif tag == 'comment': 6812 obj.comment = Reader.read_string(reader) 6813 elif tag == 'description': 6814 obj.description = Reader.read_string(reader) 6815 elif tag == 'instance_type': 6816 obj.instance_type = InstanceTypeReader.read_one(reader) 6817 elif tag == 'name': 6818 obj.name = Reader.read_string(reader) 6819 elif tag == 'port': 6820 obj.port = Reader.read_integer(reader) 6821 elif tag == 'protocol': 6822 obj.protocol = Reader.read_enum(types.GraphicsType, reader) 6823 elif tag == 'template': 6824 obj.template = TemplateReader.read_one(reader) 6825 elif tag == 'tls_port': 6826 obj.tls_port = Reader.read_integer(reader) 6827 elif tag == 'vm': 6828 obj.vm = VmReader.read_one(reader) 6829 else: 6830 reader.next_element() 6831 for link in links: 6832 GraphicsConsoleReader._process_link(link, obj) 6833 6834 # Discard the end tag: 6835 reader.read() 6836 6837 return obj 6838 6839 @staticmethod 6840 def read_many(reader): 6841 # Do nothing if there aren't more tags: 6842 objs = List() 6843 if not reader.forward(): 6844 return objs 6845 6846 # Process the attributes: 6847 objs.href = reader.get_attribute('href') 6848 6849 # Discard the start tag: 6850 empty = reader.empty_element() 6851 reader.read() 6852 if empty: 6853 return objs 6854 6855 # Process the inner elements: 6856 while reader.forward(): 6857 objs.append(GraphicsConsoleReader.read_one(reader)) 6858 6859 # Discard the end tag: 6860 reader.read() 6861 6862 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6784 @staticmethod 6785 def read_one(reader): 6786 # Do nothing if there aren't more tags: 6787 if not reader.forward(): 6788 return None 6789 6790 # Create the object: 6791 obj = types.GraphicsConsole() 6792 6793 # Process the attributes: 6794 obj.href = reader.get_attribute('href') 6795 value = reader.get_attribute('id') 6796 if value is not None: 6797 obj.id = value 6798 6799 # Discard the start tag: 6800 empty = reader.empty_element() 6801 reader.read() 6802 if empty: 6803 return obj 6804 6805 # Process the inner elements: 6806 links = [] 6807 while reader.forward(): 6808 tag = reader.node_name() 6809 if tag == 'address': 6810 obj.address = Reader.read_string(reader) 6811 elif tag == 'comment': 6812 obj.comment = Reader.read_string(reader) 6813 elif tag == 'description': 6814 obj.description = Reader.read_string(reader) 6815 elif tag == 'instance_type': 6816 obj.instance_type = InstanceTypeReader.read_one(reader) 6817 elif tag == 'name': 6818 obj.name = Reader.read_string(reader) 6819 elif tag == 'port': 6820 obj.port = Reader.read_integer(reader) 6821 elif tag == 'protocol': 6822 obj.protocol = Reader.read_enum(types.GraphicsType, reader) 6823 elif tag == 'template': 6824 obj.template = TemplateReader.read_one(reader) 6825 elif tag == 'tls_port': 6826 obj.tls_port = Reader.read_integer(reader) 6827 elif tag == 'vm': 6828 obj.vm = VmReader.read_one(reader) 6829 else: 6830 reader.next_element() 6831 for link in links: 6832 GraphicsConsoleReader._process_link(link, obj) 6833 6834 # Discard the end tag: 6835 reader.read() 6836 6837 return obj
6839 @staticmethod 6840 def read_many(reader): 6841 # Do nothing if there aren't more tags: 6842 objs = List() 6843 if not reader.forward(): 6844 return objs 6845 6846 # Process the attributes: 6847 objs.href = reader.get_attribute('href') 6848 6849 # Discard the start tag: 6850 empty = reader.empty_element() 6851 reader.read() 6852 if empty: 6853 return objs 6854 6855 # Process the inner elements: 6856 while reader.forward(): 6857 objs.append(GraphicsConsoleReader.read_one(reader)) 6858 6859 # Discard the end tag: 6860 reader.read() 6861 6862 return objs
6865class GroupReader(Reader): 6866 6867 def __init__(self): 6868 super(GroupReader, self).__init__() 6869 6870 @staticmethod 6871 def read_one(reader): 6872 # Do nothing if there aren't more tags: 6873 if not reader.forward(): 6874 return None 6875 6876 # Create the object: 6877 obj = types.Group() 6878 6879 # Process the attributes: 6880 obj.href = reader.get_attribute('href') 6881 value = reader.get_attribute('id') 6882 if value is not None: 6883 obj.id = value 6884 6885 # Discard the start tag: 6886 empty = reader.empty_element() 6887 reader.read() 6888 if empty: 6889 return obj 6890 6891 # Process the inner elements: 6892 links = [] 6893 while reader.forward(): 6894 tag = reader.node_name() 6895 if tag == 'comment': 6896 obj.comment = Reader.read_string(reader) 6897 elif tag == 'description': 6898 obj.description = Reader.read_string(reader) 6899 elif tag == 'domain': 6900 obj.domain = DomainReader.read_one(reader) 6901 elif tag == 'domain_entry_id': 6902 obj.domain_entry_id = Reader.read_string(reader) 6903 elif tag == 'name': 6904 obj.name = Reader.read_string(reader) 6905 elif tag == 'namespace': 6906 obj.namespace = Reader.read_string(reader) 6907 elif tag == 'permissions': 6908 obj.permissions = PermissionReader.read_many(reader) 6909 elif tag == 'roles': 6910 obj.roles = RoleReader.read_many(reader) 6911 elif tag == 'tags': 6912 obj.tags = TagReader.read_many(reader) 6913 elif tag == 'link': 6914 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6915 reader.next_element() 6916 else: 6917 reader.next_element() 6918 for link in links: 6919 GroupReader._process_link(link, obj) 6920 6921 # Discard the end tag: 6922 reader.read() 6923 6924 return obj 6925 6926 @staticmethod 6927 def read_many(reader): 6928 # Do nothing if there aren't more tags: 6929 objs = List() 6930 if not reader.forward(): 6931 return objs 6932 6933 # Process the attributes: 6934 objs.href = reader.get_attribute('href') 6935 6936 # Discard the start tag: 6937 empty = reader.empty_element() 6938 reader.read() 6939 if empty: 6940 return objs 6941 6942 # Process the inner elements: 6943 while reader.forward(): 6944 objs.append(GroupReader.read_one(reader)) 6945 6946 # Discard the end tag: 6947 reader.read() 6948 6949 return objs 6950 6951 @staticmethod 6952 def _process_link(link, obj): 6953 # Process the attributes: 6954 rel = link[0] 6955 href = link[1] 6956 if href and rel: 6957 if rel == "permissions": 6958 if obj.permissions is not None: 6959 obj.permissions.href = href 6960 else: 6961 obj.permissions = List(href) 6962 elif rel == "roles": 6963 if obj.roles is not None: 6964 obj.roles.href = href 6965 else: 6966 obj.roles = List(href) 6967 elif rel == "tags": 6968 if obj.tags is not None: 6969 obj.tags.href = href 6970 else: 6971 obj.tags = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6870 @staticmethod 6871 def read_one(reader): 6872 # Do nothing if there aren't more tags: 6873 if not reader.forward(): 6874 return None 6875 6876 # Create the object: 6877 obj = types.Group() 6878 6879 # Process the attributes: 6880 obj.href = reader.get_attribute('href') 6881 value = reader.get_attribute('id') 6882 if value is not None: 6883 obj.id = value 6884 6885 # Discard the start tag: 6886 empty = reader.empty_element() 6887 reader.read() 6888 if empty: 6889 return obj 6890 6891 # Process the inner elements: 6892 links = [] 6893 while reader.forward(): 6894 tag = reader.node_name() 6895 if tag == 'comment': 6896 obj.comment = Reader.read_string(reader) 6897 elif tag == 'description': 6898 obj.description = Reader.read_string(reader) 6899 elif tag == 'domain': 6900 obj.domain = DomainReader.read_one(reader) 6901 elif tag == 'domain_entry_id': 6902 obj.domain_entry_id = Reader.read_string(reader) 6903 elif tag == 'name': 6904 obj.name = Reader.read_string(reader) 6905 elif tag == 'namespace': 6906 obj.namespace = Reader.read_string(reader) 6907 elif tag == 'permissions': 6908 obj.permissions = PermissionReader.read_many(reader) 6909 elif tag == 'roles': 6910 obj.roles = RoleReader.read_many(reader) 6911 elif tag == 'tags': 6912 obj.tags = TagReader.read_many(reader) 6913 elif tag == 'link': 6914 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 6915 reader.next_element() 6916 else: 6917 reader.next_element() 6918 for link in links: 6919 GroupReader._process_link(link, obj) 6920 6921 # Discard the end tag: 6922 reader.read() 6923 6924 return obj
6926 @staticmethod 6927 def read_many(reader): 6928 # Do nothing if there aren't more tags: 6929 objs = List() 6930 if not reader.forward(): 6931 return objs 6932 6933 # Process the attributes: 6934 objs.href = reader.get_attribute('href') 6935 6936 # Discard the start tag: 6937 empty = reader.empty_element() 6938 reader.read() 6939 if empty: 6940 return objs 6941 6942 # Process the inner elements: 6943 while reader.forward(): 6944 objs.append(GroupReader.read_one(reader)) 6945 6946 # Discard the end tag: 6947 reader.read() 6948 6949 return objs
6974class GuestOperatingSystemReader(Reader): 6975 6976 def __init__(self): 6977 super(GuestOperatingSystemReader, self).__init__() 6978 6979 @staticmethod 6980 def read_one(reader): 6981 # Do nothing if there aren't more tags: 6982 if not reader.forward(): 6983 return None 6984 6985 # Create the object: 6986 obj = types.GuestOperatingSystem() 6987 6988 # Process the attributes: 6989 obj.href = reader.get_attribute('href') 6990 6991 # Discard the start tag: 6992 empty = reader.empty_element() 6993 reader.read() 6994 if empty: 6995 return obj 6996 6997 # Process the inner elements: 6998 links = [] 6999 while reader.forward(): 7000 tag = reader.node_name() 7001 if tag == 'architecture': 7002 obj.architecture = Reader.read_string(reader) 7003 elif tag == 'codename': 7004 obj.codename = Reader.read_string(reader) 7005 elif tag == 'distribution': 7006 obj.distribution = Reader.read_string(reader) 7007 elif tag == 'family': 7008 obj.family = Reader.read_string(reader) 7009 elif tag == 'kernel': 7010 obj.kernel = KernelReader.read_one(reader) 7011 elif tag == 'version': 7012 obj.version = VersionReader.read_one(reader) 7013 else: 7014 reader.next_element() 7015 for link in links: 7016 GuestOperatingSystemReader._process_link(link, obj) 7017 7018 # Discard the end tag: 7019 reader.read() 7020 7021 return obj 7022 7023 @staticmethod 7024 def read_many(reader): 7025 # Do nothing if there aren't more tags: 7026 objs = List() 7027 if not reader.forward(): 7028 return objs 7029 7030 # Process the attributes: 7031 objs.href = reader.get_attribute('href') 7032 7033 # Discard the start tag: 7034 empty = reader.empty_element() 7035 reader.read() 7036 if empty: 7037 return objs 7038 7039 # Process the inner elements: 7040 while reader.forward(): 7041 objs.append(GuestOperatingSystemReader.read_one(reader)) 7042 7043 # Discard the end tag: 7044 reader.read() 7045 7046 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
6979 @staticmethod 6980 def read_one(reader): 6981 # Do nothing if there aren't more tags: 6982 if not reader.forward(): 6983 return None 6984 6985 # Create the object: 6986 obj = types.GuestOperatingSystem() 6987 6988 # Process the attributes: 6989 obj.href = reader.get_attribute('href') 6990 6991 # Discard the start tag: 6992 empty = reader.empty_element() 6993 reader.read() 6994 if empty: 6995 return obj 6996 6997 # Process the inner elements: 6998 links = [] 6999 while reader.forward(): 7000 tag = reader.node_name() 7001 if tag == 'architecture': 7002 obj.architecture = Reader.read_string(reader) 7003 elif tag == 'codename': 7004 obj.codename = Reader.read_string(reader) 7005 elif tag == 'distribution': 7006 obj.distribution = Reader.read_string(reader) 7007 elif tag == 'family': 7008 obj.family = Reader.read_string(reader) 7009 elif tag == 'kernel': 7010 obj.kernel = KernelReader.read_one(reader) 7011 elif tag == 'version': 7012 obj.version = VersionReader.read_one(reader) 7013 else: 7014 reader.next_element() 7015 for link in links: 7016 GuestOperatingSystemReader._process_link(link, obj) 7017 7018 # Discard the end tag: 7019 reader.read() 7020 7021 return obj
7023 @staticmethod 7024 def read_many(reader): 7025 # Do nothing if there aren't more tags: 7026 objs = List() 7027 if not reader.forward(): 7028 return objs 7029 7030 # Process the attributes: 7031 objs.href = reader.get_attribute('href') 7032 7033 # Discard the start tag: 7034 empty = reader.empty_element() 7035 reader.read() 7036 if empty: 7037 return objs 7038 7039 # Process the inner elements: 7040 while reader.forward(): 7041 objs.append(GuestOperatingSystemReader.read_one(reader)) 7042 7043 # Discard the end tag: 7044 reader.read() 7045 7046 return objs
7049class HardwareInformationReader(Reader): 7050 7051 def __init__(self): 7052 super(HardwareInformationReader, self).__init__() 7053 7054 @staticmethod 7055 def read_one(reader): 7056 # Do nothing if there aren't more tags: 7057 if not reader.forward(): 7058 return None 7059 7060 # Create the object: 7061 obj = types.HardwareInformation() 7062 7063 # Process the attributes: 7064 obj.href = reader.get_attribute('href') 7065 7066 # Discard the start tag: 7067 empty = reader.empty_element() 7068 reader.read() 7069 if empty: 7070 return obj 7071 7072 # Process the inner elements: 7073 links = [] 7074 while reader.forward(): 7075 tag = reader.node_name() 7076 if tag == 'family': 7077 obj.family = Reader.read_string(reader) 7078 elif tag == 'manufacturer': 7079 obj.manufacturer = Reader.read_string(reader) 7080 elif tag == 'product_name': 7081 obj.product_name = Reader.read_string(reader) 7082 elif tag == 'serial_number': 7083 obj.serial_number = Reader.read_string(reader) 7084 elif tag == 'supported_rng_sources': 7085 obj.supported_rng_sources = Reader.read_enums(types.RngSource, reader) 7086 elif tag == 'uuid': 7087 obj.uuid = Reader.read_string(reader) 7088 elif tag == 'version': 7089 obj.version = Reader.read_string(reader) 7090 else: 7091 reader.next_element() 7092 for link in links: 7093 HardwareInformationReader._process_link(link, obj) 7094 7095 # Discard the end tag: 7096 reader.read() 7097 7098 return obj 7099 7100 @staticmethod 7101 def read_many(reader): 7102 # Do nothing if there aren't more tags: 7103 objs = List() 7104 if not reader.forward(): 7105 return objs 7106 7107 # Process the attributes: 7108 objs.href = reader.get_attribute('href') 7109 7110 # Discard the start tag: 7111 empty = reader.empty_element() 7112 reader.read() 7113 if empty: 7114 return objs 7115 7116 # Process the inner elements: 7117 while reader.forward(): 7118 objs.append(HardwareInformationReader.read_one(reader)) 7119 7120 # Discard the end tag: 7121 reader.read() 7122 7123 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7054 @staticmethod 7055 def read_one(reader): 7056 # Do nothing if there aren't more tags: 7057 if not reader.forward(): 7058 return None 7059 7060 # Create the object: 7061 obj = types.HardwareInformation() 7062 7063 # Process the attributes: 7064 obj.href = reader.get_attribute('href') 7065 7066 # Discard the start tag: 7067 empty = reader.empty_element() 7068 reader.read() 7069 if empty: 7070 return obj 7071 7072 # Process the inner elements: 7073 links = [] 7074 while reader.forward(): 7075 tag = reader.node_name() 7076 if tag == 'family': 7077 obj.family = Reader.read_string(reader) 7078 elif tag == 'manufacturer': 7079 obj.manufacturer = Reader.read_string(reader) 7080 elif tag == 'product_name': 7081 obj.product_name = Reader.read_string(reader) 7082 elif tag == 'serial_number': 7083 obj.serial_number = Reader.read_string(reader) 7084 elif tag == 'supported_rng_sources': 7085 obj.supported_rng_sources = Reader.read_enums(types.RngSource, reader) 7086 elif tag == 'uuid': 7087 obj.uuid = Reader.read_string(reader) 7088 elif tag == 'version': 7089 obj.version = Reader.read_string(reader) 7090 else: 7091 reader.next_element() 7092 for link in links: 7093 HardwareInformationReader._process_link(link, obj) 7094 7095 # Discard the end tag: 7096 reader.read() 7097 7098 return obj
7100 @staticmethod 7101 def read_many(reader): 7102 # Do nothing if there aren't more tags: 7103 objs = List() 7104 if not reader.forward(): 7105 return objs 7106 7107 # Process the attributes: 7108 objs.href = reader.get_attribute('href') 7109 7110 # Discard the start tag: 7111 empty = reader.empty_element() 7112 reader.read() 7113 if empty: 7114 return objs 7115 7116 # Process the inner elements: 7117 while reader.forward(): 7118 objs.append(HardwareInformationReader.read_one(reader)) 7119 7120 # Discard the end tag: 7121 reader.read() 7122 7123 return objs
7126class HighAvailabilityReader(Reader): 7127 7128 def __init__(self): 7129 super(HighAvailabilityReader, self).__init__() 7130 7131 @staticmethod 7132 def read_one(reader): 7133 # Do nothing if there aren't more tags: 7134 if not reader.forward(): 7135 return None 7136 7137 # Create the object: 7138 obj = types.HighAvailability() 7139 7140 # Process the attributes: 7141 obj.href = reader.get_attribute('href') 7142 7143 # Discard the start tag: 7144 empty = reader.empty_element() 7145 reader.read() 7146 if empty: 7147 return obj 7148 7149 # Process the inner elements: 7150 links = [] 7151 while reader.forward(): 7152 tag = reader.node_name() 7153 if tag == 'enabled': 7154 obj.enabled = Reader.read_boolean(reader) 7155 elif tag == 'priority': 7156 obj.priority = Reader.read_integer(reader) 7157 else: 7158 reader.next_element() 7159 for link in links: 7160 HighAvailabilityReader._process_link(link, obj) 7161 7162 # Discard the end tag: 7163 reader.read() 7164 7165 return obj 7166 7167 @staticmethod 7168 def read_many(reader): 7169 # Do nothing if there aren't more tags: 7170 objs = List() 7171 if not reader.forward(): 7172 return objs 7173 7174 # Process the attributes: 7175 objs.href = reader.get_attribute('href') 7176 7177 # Discard the start tag: 7178 empty = reader.empty_element() 7179 reader.read() 7180 if empty: 7181 return objs 7182 7183 # Process the inner elements: 7184 while reader.forward(): 7185 objs.append(HighAvailabilityReader.read_one(reader)) 7186 7187 # Discard the end tag: 7188 reader.read() 7189 7190 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7131 @staticmethod 7132 def read_one(reader): 7133 # Do nothing if there aren't more tags: 7134 if not reader.forward(): 7135 return None 7136 7137 # Create the object: 7138 obj = types.HighAvailability() 7139 7140 # Process the attributes: 7141 obj.href = reader.get_attribute('href') 7142 7143 # Discard the start tag: 7144 empty = reader.empty_element() 7145 reader.read() 7146 if empty: 7147 return obj 7148 7149 # Process the inner elements: 7150 links = [] 7151 while reader.forward(): 7152 tag = reader.node_name() 7153 if tag == 'enabled': 7154 obj.enabled = Reader.read_boolean(reader) 7155 elif tag == 'priority': 7156 obj.priority = Reader.read_integer(reader) 7157 else: 7158 reader.next_element() 7159 for link in links: 7160 HighAvailabilityReader._process_link(link, obj) 7161 7162 # Discard the end tag: 7163 reader.read() 7164 7165 return obj
7167 @staticmethod 7168 def read_many(reader): 7169 # Do nothing if there aren't more tags: 7170 objs = List() 7171 if not reader.forward(): 7172 return objs 7173 7174 # Process the attributes: 7175 objs.href = reader.get_attribute('href') 7176 7177 # Discard the start tag: 7178 empty = reader.empty_element() 7179 reader.read() 7180 if empty: 7181 return objs 7182 7183 # Process the inner elements: 7184 while reader.forward(): 7185 objs.append(HighAvailabilityReader.read_one(reader)) 7186 7187 # Discard the end tag: 7188 reader.read() 7189 7190 return objs
7193class HookReader(Reader): 7194 7195 def __init__(self): 7196 super(HookReader, self).__init__() 7197 7198 @staticmethod 7199 def read_one(reader): 7200 # Do nothing if there aren't more tags: 7201 if not reader.forward(): 7202 return None 7203 7204 # Create the object: 7205 obj = types.Hook() 7206 7207 # Process the attributes: 7208 obj.href = reader.get_attribute('href') 7209 value = reader.get_attribute('id') 7210 if value is not None: 7211 obj.id = value 7212 7213 # Discard the start tag: 7214 empty = reader.empty_element() 7215 reader.read() 7216 if empty: 7217 return obj 7218 7219 # Process the inner elements: 7220 links = [] 7221 while reader.forward(): 7222 tag = reader.node_name() 7223 if tag == 'comment': 7224 obj.comment = Reader.read_string(reader) 7225 elif tag == 'description': 7226 obj.description = Reader.read_string(reader) 7227 elif tag == 'event_name': 7228 obj.event_name = Reader.read_string(reader) 7229 elif tag == 'host': 7230 obj.host = HostReader.read_one(reader) 7231 elif tag == 'md5': 7232 obj.md5 = Reader.read_string(reader) 7233 elif tag == 'name': 7234 obj.name = Reader.read_string(reader) 7235 else: 7236 reader.next_element() 7237 for link in links: 7238 HookReader._process_link(link, obj) 7239 7240 # Discard the end tag: 7241 reader.read() 7242 7243 return obj 7244 7245 @staticmethod 7246 def read_many(reader): 7247 # Do nothing if there aren't more tags: 7248 objs = List() 7249 if not reader.forward(): 7250 return objs 7251 7252 # Process the attributes: 7253 objs.href = reader.get_attribute('href') 7254 7255 # Discard the start tag: 7256 empty = reader.empty_element() 7257 reader.read() 7258 if empty: 7259 return objs 7260 7261 # Process the inner elements: 7262 while reader.forward(): 7263 objs.append(HookReader.read_one(reader)) 7264 7265 # Discard the end tag: 7266 reader.read() 7267 7268 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7198 @staticmethod 7199 def read_one(reader): 7200 # Do nothing if there aren't more tags: 7201 if not reader.forward(): 7202 return None 7203 7204 # Create the object: 7205 obj = types.Hook() 7206 7207 # Process the attributes: 7208 obj.href = reader.get_attribute('href') 7209 value = reader.get_attribute('id') 7210 if value is not None: 7211 obj.id = value 7212 7213 # Discard the start tag: 7214 empty = reader.empty_element() 7215 reader.read() 7216 if empty: 7217 return obj 7218 7219 # Process the inner elements: 7220 links = [] 7221 while reader.forward(): 7222 tag = reader.node_name() 7223 if tag == 'comment': 7224 obj.comment = Reader.read_string(reader) 7225 elif tag == 'description': 7226 obj.description = Reader.read_string(reader) 7227 elif tag == 'event_name': 7228 obj.event_name = Reader.read_string(reader) 7229 elif tag == 'host': 7230 obj.host = HostReader.read_one(reader) 7231 elif tag == 'md5': 7232 obj.md5 = Reader.read_string(reader) 7233 elif tag == 'name': 7234 obj.name = Reader.read_string(reader) 7235 else: 7236 reader.next_element() 7237 for link in links: 7238 HookReader._process_link(link, obj) 7239 7240 # Discard the end tag: 7241 reader.read() 7242 7243 return obj
7245 @staticmethod 7246 def read_many(reader): 7247 # Do nothing if there aren't more tags: 7248 objs = List() 7249 if not reader.forward(): 7250 return objs 7251 7252 # Process the attributes: 7253 objs.href = reader.get_attribute('href') 7254 7255 # Discard the start tag: 7256 empty = reader.empty_element() 7257 reader.read() 7258 if empty: 7259 return objs 7260 7261 # Process the inner elements: 7262 while reader.forward(): 7263 objs.append(HookReader.read_one(reader)) 7264 7265 # Discard the end tag: 7266 reader.read() 7267 7268 return objs
7271class HostReader(Reader): 7272 7273 def __init__(self): 7274 super(HostReader, self).__init__() 7275 7276 @staticmethod 7277 def read_one(reader): 7278 # Do nothing if there aren't more tags: 7279 if not reader.forward(): 7280 return None 7281 7282 # Create the object: 7283 obj = types.Host() 7284 7285 # Process the attributes: 7286 obj.href = reader.get_attribute('href') 7287 value = reader.get_attribute('id') 7288 if value is not None: 7289 obj.id = value 7290 7291 # Discard the start tag: 7292 empty = reader.empty_element() 7293 reader.read() 7294 if empty: 7295 return obj 7296 7297 # Process the inner elements: 7298 links = [] 7299 while reader.forward(): 7300 tag = reader.node_name() 7301 if tag == 'address': 7302 obj.address = Reader.read_string(reader) 7303 elif tag == 'affinity_labels': 7304 obj.affinity_labels = AffinityLabelReader.read_many(reader) 7305 elif tag == 'agents': 7306 obj.agents = AgentReader.read_many(reader) 7307 elif tag == 'auto_numa_status': 7308 obj.auto_numa_status = Reader.read_enum(types.AutoNumaStatus, reader) 7309 elif tag == 'certificate': 7310 obj.certificate = CertificateReader.read_one(reader) 7311 elif tag == 'cluster': 7312 obj.cluster = ClusterReader.read_one(reader) 7313 elif tag == 'comment': 7314 obj.comment = Reader.read_string(reader) 7315 elif tag == 'cpu': 7316 obj.cpu = CpuReader.read_one(reader) 7317 elif tag == 'cpu_units': 7318 obj.cpu_units = HostCpuUnitReader.read_many(reader) 7319 elif tag == 'description': 7320 obj.description = Reader.read_string(reader) 7321 elif tag == 'device_passthrough': 7322 obj.device_passthrough = HostDevicePassthroughReader.read_one(reader) 7323 elif tag == 'devices': 7324 obj.devices = HostDeviceReader.read_many(reader) 7325 elif tag == 'display': 7326 obj.display = DisplayReader.read_one(reader) 7327 elif tag == 'external_host_provider': 7328 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 7329 elif tag == 'external_network_provider_configurations': 7330 obj.external_network_provider_configurations = ExternalNetworkProviderConfigurationReader.read_many(reader) 7331 elif tag == 'external_status': 7332 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 7333 elif tag == 'hardware_information': 7334 obj.hardware_information = HardwareInformationReader.read_one(reader) 7335 elif tag == 'hooks': 7336 obj.hooks = HookReader.read_many(reader) 7337 elif tag == 'hosted_engine': 7338 obj.hosted_engine = HostedEngineReader.read_one(reader) 7339 elif tag == 'iscsi': 7340 obj.iscsi = IscsiDetailsReader.read_one(reader) 7341 elif tag == 'katello_errata': 7342 obj.katello_errata = KatelloErratumReader.read_many(reader) 7343 elif tag == 'kdump_status': 7344 obj.kdump_status = Reader.read_enum(types.KdumpStatus, reader) 7345 elif tag == 'ksm': 7346 obj.ksm = KsmReader.read_one(reader) 7347 elif tag == 'libvirt_version': 7348 obj.libvirt_version = VersionReader.read_one(reader) 7349 elif tag == 'max_scheduling_memory': 7350 obj.max_scheduling_memory = Reader.read_integer(reader) 7351 elif tag == 'memory': 7352 obj.memory = Reader.read_integer(reader) 7353 elif tag == 'name': 7354 obj.name = Reader.read_string(reader) 7355 elif tag == 'network_attachments': 7356 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 7357 elif tag == 'network_operation_in_progress': 7358 obj.network_operation_in_progress = Reader.read_boolean(reader) 7359 elif tag == 'nics': 7360 obj.nics = HostNicReader.read_many(reader) 7361 elif tag == 'host_numa_nodes': 7362 obj.numa_nodes = NumaNodeReader.read_many(reader) 7363 elif tag == 'numa_supported': 7364 obj.numa_supported = Reader.read_boolean(reader) 7365 elif tag == 'os': 7366 obj.os = OperatingSystemReader.read_one(reader) 7367 elif tag == 'override_iptables': 7368 obj.override_iptables = Reader.read_boolean(reader) 7369 elif tag == 'ovn_configured': 7370 obj.ovn_configured = Reader.read_boolean(reader) 7371 elif tag == 'permissions': 7372 obj.permissions = PermissionReader.read_many(reader) 7373 elif tag == 'port': 7374 obj.port = Reader.read_integer(reader) 7375 elif tag == 'power_management': 7376 obj.power_management = PowerManagementReader.read_one(reader) 7377 elif tag == 'protocol': 7378 obj.protocol = Reader.read_enum(types.HostProtocol, reader) 7379 elif tag == 'reinstallation_required': 7380 obj.reinstallation_required = Reader.read_boolean(reader) 7381 elif tag == 'root_password': 7382 obj.root_password = Reader.read_string(reader) 7383 elif tag == 'se_linux': 7384 obj.se_linux = SeLinuxReader.read_one(reader) 7385 elif tag == 'spm': 7386 obj.spm = SpmReader.read_one(reader) 7387 elif tag == 'ssh': 7388 obj.ssh = SshReader.read_one(reader) 7389 elif tag == 'statistics': 7390 obj.statistics = StatisticReader.read_many(reader) 7391 elif tag == 'status': 7392 obj.status = Reader.read_enum(types.HostStatus, reader) 7393 elif tag == 'status_detail': 7394 obj.status_detail = Reader.read_string(reader) 7395 elif tag == 'storage_connection_extensions': 7396 obj.storage_connection_extensions = StorageConnectionExtensionReader.read_many(reader) 7397 elif tag == 'storages': 7398 obj.storages = HostStorageReader.read_many(reader) 7399 elif tag == 'summary': 7400 obj.summary = VmSummaryReader.read_one(reader) 7401 elif tag == 'tags': 7402 obj.tags = TagReader.read_many(reader) 7403 elif tag == 'transparent_hugepages': 7404 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 7405 elif tag == 'type': 7406 obj.type = Reader.read_enum(types.HostType, reader) 7407 elif tag == 'unmanaged_networks': 7408 obj.unmanaged_networks = UnmanagedNetworkReader.read_many(reader) 7409 elif tag == 'update_available': 7410 obj.update_available = Reader.read_boolean(reader) 7411 elif tag == 'version': 7412 obj.version = VersionReader.read_one(reader) 7413 elif tag == 'vgpu_placement': 7414 obj.vgpu_placement = Reader.read_enum(types.VgpuPlacement, reader) 7415 elif tag == 'link': 7416 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7417 reader.next_element() 7418 else: 7419 reader.next_element() 7420 for link in links: 7421 HostReader._process_link(link, obj) 7422 7423 # Discard the end tag: 7424 reader.read() 7425 7426 return obj 7427 7428 @staticmethod 7429 def read_many(reader): 7430 # Do nothing if there aren't more tags: 7431 objs = List() 7432 if not reader.forward(): 7433 return objs 7434 7435 # Process the attributes: 7436 objs.href = reader.get_attribute('href') 7437 7438 # Discard the start tag: 7439 empty = reader.empty_element() 7440 reader.read() 7441 if empty: 7442 return objs 7443 7444 # Process the inner elements: 7445 while reader.forward(): 7446 objs.append(HostReader.read_one(reader)) 7447 7448 # Discard the end tag: 7449 reader.read() 7450 7451 return objs 7452 7453 @staticmethod 7454 def _process_link(link, obj): 7455 # Process the attributes: 7456 rel = link[0] 7457 href = link[1] 7458 if href and rel: 7459 if rel == "affinitylabels": 7460 if obj.affinity_labels is not None: 7461 obj.affinity_labels.href = href 7462 else: 7463 obj.affinity_labels = List(href) 7464 elif rel == "agents": 7465 if obj.agents is not None: 7466 obj.agents.href = href 7467 else: 7468 obj.agents = List(href) 7469 elif rel == "cpuunits": 7470 if obj.cpu_units is not None: 7471 obj.cpu_units.href = href 7472 else: 7473 obj.cpu_units = List(href) 7474 elif rel == "devices": 7475 if obj.devices is not None: 7476 obj.devices.href = href 7477 else: 7478 obj.devices = List(href) 7479 elif rel == "externalnetworkproviderconfigurations": 7480 if obj.external_network_provider_configurations is not None: 7481 obj.external_network_provider_configurations.href = href 7482 else: 7483 obj.external_network_provider_configurations = List(href) 7484 elif rel == "hooks": 7485 if obj.hooks is not None: 7486 obj.hooks.href = href 7487 else: 7488 obj.hooks = List(href) 7489 elif rel == "katelloerrata": 7490 if obj.katello_errata is not None: 7491 obj.katello_errata.href = href 7492 else: 7493 obj.katello_errata = List(href) 7494 elif rel == "networkattachments": 7495 if obj.network_attachments is not None: 7496 obj.network_attachments.href = href 7497 else: 7498 obj.network_attachments = List(href) 7499 elif rel == "nics": 7500 if obj.nics is not None: 7501 obj.nics.href = href 7502 else: 7503 obj.nics = List(href) 7504 elif rel == "numanodes": 7505 if obj.numa_nodes is not None: 7506 obj.numa_nodes.href = href 7507 else: 7508 obj.numa_nodes = List(href) 7509 elif rel == "permissions": 7510 if obj.permissions is not None: 7511 obj.permissions.href = href 7512 else: 7513 obj.permissions = List(href) 7514 elif rel == "statistics": 7515 if obj.statistics is not None: 7516 obj.statistics.href = href 7517 else: 7518 obj.statistics = List(href) 7519 elif rel == "storageconnectionextensions": 7520 if obj.storage_connection_extensions is not None: 7521 obj.storage_connection_extensions.href = href 7522 else: 7523 obj.storage_connection_extensions = List(href) 7524 elif rel == "storages": 7525 if obj.storages is not None: 7526 obj.storages.href = href 7527 else: 7528 obj.storages = List(href) 7529 elif rel == "tags": 7530 if obj.tags is not None: 7531 obj.tags.href = href 7532 else: 7533 obj.tags = List(href) 7534 elif rel == "unmanagednetworks": 7535 if obj.unmanaged_networks is not None: 7536 obj.unmanaged_networks.href = href 7537 else: 7538 obj.unmanaged_networks = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7276 @staticmethod 7277 def read_one(reader): 7278 # Do nothing if there aren't more tags: 7279 if not reader.forward(): 7280 return None 7281 7282 # Create the object: 7283 obj = types.Host() 7284 7285 # Process the attributes: 7286 obj.href = reader.get_attribute('href') 7287 value = reader.get_attribute('id') 7288 if value is not None: 7289 obj.id = value 7290 7291 # Discard the start tag: 7292 empty = reader.empty_element() 7293 reader.read() 7294 if empty: 7295 return obj 7296 7297 # Process the inner elements: 7298 links = [] 7299 while reader.forward(): 7300 tag = reader.node_name() 7301 if tag == 'address': 7302 obj.address = Reader.read_string(reader) 7303 elif tag == 'affinity_labels': 7304 obj.affinity_labels = AffinityLabelReader.read_many(reader) 7305 elif tag == 'agents': 7306 obj.agents = AgentReader.read_many(reader) 7307 elif tag == 'auto_numa_status': 7308 obj.auto_numa_status = Reader.read_enum(types.AutoNumaStatus, reader) 7309 elif tag == 'certificate': 7310 obj.certificate = CertificateReader.read_one(reader) 7311 elif tag == 'cluster': 7312 obj.cluster = ClusterReader.read_one(reader) 7313 elif tag == 'comment': 7314 obj.comment = Reader.read_string(reader) 7315 elif tag == 'cpu': 7316 obj.cpu = CpuReader.read_one(reader) 7317 elif tag == 'cpu_units': 7318 obj.cpu_units = HostCpuUnitReader.read_many(reader) 7319 elif tag == 'description': 7320 obj.description = Reader.read_string(reader) 7321 elif tag == 'device_passthrough': 7322 obj.device_passthrough = HostDevicePassthroughReader.read_one(reader) 7323 elif tag == 'devices': 7324 obj.devices = HostDeviceReader.read_many(reader) 7325 elif tag == 'display': 7326 obj.display = DisplayReader.read_one(reader) 7327 elif tag == 'external_host_provider': 7328 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 7329 elif tag == 'external_network_provider_configurations': 7330 obj.external_network_provider_configurations = ExternalNetworkProviderConfigurationReader.read_many(reader) 7331 elif tag == 'external_status': 7332 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 7333 elif tag == 'hardware_information': 7334 obj.hardware_information = HardwareInformationReader.read_one(reader) 7335 elif tag == 'hooks': 7336 obj.hooks = HookReader.read_many(reader) 7337 elif tag == 'hosted_engine': 7338 obj.hosted_engine = HostedEngineReader.read_one(reader) 7339 elif tag == 'iscsi': 7340 obj.iscsi = IscsiDetailsReader.read_one(reader) 7341 elif tag == 'katello_errata': 7342 obj.katello_errata = KatelloErratumReader.read_many(reader) 7343 elif tag == 'kdump_status': 7344 obj.kdump_status = Reader.read_enum(types.KdumpStatus, reader) 7345 elif tag == 'ksm': 7346 obj.ksm = KsmReader.read_one(reader) 7347 elif tag == 'libvirt_version': 7348 obj.libvirt_version = VersionReader.read_one(reader) 7349 elif tag == 'max_scheduling_memory': 7350 obj.max_scheduling_memory = Reader.read_integer(reader) 7351 elif tag == 'memory': 7352 obj.memory = Reader.read_integer(reader) 7353 elif tag == 'name': 7354 obj.name = Reader.read_string(reader) 7355 elif tag == 'network_attachments': 7356 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 7357 elif tag == 'network_operation_in_progress': 7358 obj.network_operation_in_progress = Reader.read_boolean(reader) 7359 elif tag == 'nics': 7360 obj.nics = HostNicReader.read_many(reader) 7361 elif tag == 'host_numa_nodes': 7362 obj.numa_nodes = NumaNodeReader.read_many(reader) 7363 elif tag == 'numa_supported': 7364 obj.numa_supported = Reader.read_boolean(reader) 7365 elif tag == 'os': 7366 obj.os = OperatingSystemReader.read_one(reader) 7367 elif tag == 'override_iptables': 7368 obj.override_iptables = Reader.read_boolean(reader) 7369 elif tag == 'ovn_configured': 7370 obj.ovn_configured = Reader.read_boolean(reader) 7371 elif tag == 'permissions': 7372 obj.permissions = PermissionReader.read_many(reader) 7373 elif tag == 'port': 7374 obj.port = Reader.read_integer(reader) 7375 elif tag == 'power_management': 7376 obj.power_management = PowerManagementReader.read_one(reader) 7377 elif tag == 'protocol': 7378 obj.protocol = Reader.read_enum(types.HostProtocol, reader) 7379 elif tag == 'reinstallation_required': 7380 obj.reinstallation_required = Reader.read_boolean(reader) 7381 elif tag == 'root_password': 7382 obj.root_password = Reader.read_string(reader) 7383 elif tag == 'se_linux': 7384 obj.se_linux = SeLinuxReader.read_one(reader) 7385 elif tag == 'spm': 7386 obj.spm = SpmReader.read_one(reader) 7387 elif tag == 'ssh': 7388 obj.ssh = SshReader.read_one(reader) 7389 elif tag == 'statistics': 7390 obj.statistics = StatisticReader.read_many(reader) 7391 elif tag == 'status': 7392 obj.status = Reader.read_enum(types.HostStatus, reader) 7393 elif tag == 'status_detail': 7394 obj.status_detail = Reader.read_string(reader) 7395 elif tag == 'storage_connection_extensions': 7396 obj.storage_connection_extensions = StorageConnectionExtensionReader.read_many(reader) 7397 elif tag == 'storages': 7398 obj.storages = HostStorageReader.read_many(reader) 7399 elif tag == 'summary': 7400 obj.summary = VmSummaryReader.read_one(reader) 7401 elif tag == 'tags': 7402 obj.tags = TagReader.read_many(reader) 7403 elif tag == 'transparent_hugepages': 7404 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 7405 elif tag == 'type': 7406 obj.type = Reader.read_enum(types.HostType, reader) 7407 elif tag == 'unmanaged_networks': 7408 obj.unmanaged_networks = UnmanagedNetworkReader.read_many(reader) 7409 elif tag == 'update_available': 7410 obj.update_available = Reader.read_boolean(reader) 7411 elif tag == 'version': 7412 obj.version = VersionReader.read_one(reader) 7413 elif tag == 'vgpu_placement': 7414 obj.vgpu_placement = Reader.read_enum(types.VgpuPlacement, reader) 7415 elif tag == 'link': 7416 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7417 reader.next_element() 7418 else: 7419 reader.next_element() 7420 for link in links: 7421 HostReader._process_link(link, obj) 7422 7423 # Discard the end tag: 7424 reader.read() 7425 7426 return obj
7428 @staticmethod 7429 def read_many(reader): 7430 # Do nothing if there aren't more tags: 7431 objs = List() 7432 if not reader.forward(): 7433 return objs 7434 7435 # Process the attributes: 7436 objs.href = reader.get_attribute('href') 7437 7438 # Discard the start tag: 7439 empty = reader.empty_element() 7440 reader.read() 7441 if empty: 7442 return objs 7443 7444 # Process the inner elements: 7445 while reader.forward(): 7446 objs.append(HostReader.read_one(reader)) 7447 7448 # Discard the end tag: 7449 reader.read() 7450 7451 return objs
7541class HostCpuUnitReader(Reader): 7542 7543 def __init__(self): 7544 super(HostCpuUnitReader, self).__init__() 7545 7546 @staticmethod 7547 def read_one(reader): 7548 # Do nothing if there aren't more tags: 7549 if not reader.forward(): 7550 return None 7551 7552 # Create the object: 7553 obj = types.HostCpuUnit() 7554 7555 # Process the attributes: 7556 obj.href = reader.get_attribute('href') 7557 value = reader.get_attribute('id') 7558 if value is not None: 7559 obj.id = value 7560 7561 # Discard the start tag: 7562 empty = reader.empty_element() 7563 reader.read() 7564 if empty: 7565 return obj 7566 7567 # Process the inner elements: 7568 links = [] 7569 while reader.forward(): 7570 tag = reader.node_name() 7571 if tag == 'comment': 7572 obj.comment = Reader.read_string(reader) 7573 elif tag == 'core_id': 7574 obj.core_id = Reader.read_integer(reader) 7575 elif tag == 'cpu_id': 7576 obj.cpu_id = Reader.read_integer(reader) 7577 elif tag == 'description': 7578 obj.description = Reader.read_string(reader) 7579 elif tag == 'name': 7580 obj.name = Reader.read_string(reader) 7581 elif tag == 'runs_vdsm': 7582 obj.runs_vdsm = Reader.read_boolean(reader) 7583 elif tag == 'socket_id': 7584 obj.socket_id = Reader.read_integer(reader) 7585 elif tag == 'vms': 7586 obj.vms = VmReader.read_many(reader) 7587 elif tag == 'link': 7588 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7589 reader.next_element() 7590 else: 7591 reader.next_element() 7592 for link in links: 7593 HostCpuUnitReader._process_link(link, obj) 7594 7595 # Discard the end tag: 7596 reader.read() 7597 7598 return obj 7599 7600 @staticmethod 7601 def read_many(reader): 7602 # Do nothing if there aren't more tags: 7603 objs = List() 7604 if not reader.forward(): 7605 return objs 7606 7607 # Process the attributes: 7608 objs.href = reader.get_attribute('href') 7609 7610 # Discard the start tag: 7611 empty = reader.empty_element() 7612 reader.read() 7613 if empty: 7614 return objs 7615 7616 # Process the inner elements: 7617 while reader.forward(): 7618 objs.append(HostCpuUnitReader.read_one(reader)) 7619 7620 # Discard the end tag: 7621 reader.read() 7622 7623 return objs 7624 7625 @staticmethod 7626 def _process_link(link, obj): 7627 # Process the attributes: 7628 rel = link[0] 7629 href = link[1] 7630 if href and rel: 7631 if rel == "vms": 7632 if obj.vms is not None: 7633 obj.vms.href = href 7634 else: 7635 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7546 @staticmethod 7547 def read_one(reader): 7548 # Do nothing if there aren't more tags: 7549 if not reader.forward(): 7550 return None 7551 7552 # Create the object: 7553 obj = types.HostCpuUnit() 7554 7555 # Process the attributes: 7556 obj.href = reader.get_attribute('href') 7557 value = reader.get_attribute('id') 7558 if value is not None: 7559 obj.id = value 7560 7561 # Discard the start tag: 7562 empty = reader.empty_element() 7563 reader.read() 7564 if empty: 7565 return obj 7566 7567 # Process the inner elements: 7568 links = [] 7569 while reader.forward(): 7570 tag = reader.node_name() 7571 if tag == 'comment': 7572 obj.comment = Reader.read_string(reader) 7573 elif tag == 'core_id': 7574 obj.core_id = Reader.read_integer(reader) 7575 elif tag == 'cpu_id': 7576 obj.cpu_id = Reader.read_integer(reader) 7577 elif tag == 'description': 7578 obj.description = Reader.read_string(reader) 7579 elif tag == 'name': 7580 obj.name = Reader.read_string(reader) 7581 elif tag == 'runs_vdsm': 7582 obj.runs_vdsm = Reader.read_boolean(reader) 7583 elif tag == 'socket_id': 7584 obj.socket_id = Reader.read_integer(reader) 7585 elif tag == 'vms': 7586 obj.vms = VmReader.read_many(reader) 7587 elif tag == 'link': 7588 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7589 reader.next_element() 7590 else: 7591 reader.next_element() 7592 for link in links: 7593 HostCpuUnitReader._process_link(link, obj) 7594 7595 # Discard the end tag: 7596 reader.read() 7597 7598 return obj
7600 @staticmethod 7601 def read_many(reader): 7602 # Do nothing if there aren't more tags: 7603 objs = List() 7604 if not reader.forward(): 7605 return objs 7606 7607 # Process the attributes: 7608 objs.href = reader.get_attribute('href') 7609 7610 # Discard the start tag: 7611 empty = reader.empty_element() 7612 reader.read() 7613 if empty: 7614 return objs 7615 7616 # Process the inner elements: 7617 while reader.forward(): 7618 objs.append(HostCpuUnitReader.read_one(reader)) 7619 7620 # Discard the end tag: 7621 reader.read() 7622 7623 return objs
7638class HostDeviceReader(Reader): 7639 7640 def __init__(self): 7641 super(HostDeviceReader, self).__init__() 7642 7643 @staticmethod 7644 def read_one(reader): 7645 # Do nothing if there aren't more tags: 7646 if not reader.forward(): 7647 return None 7648 7649 # Create the object: 7650 obj = types.HostDevice() 7651 7652 # Process the attributes: 7653 obj.href = reader.get_attribute('href') 7654 value = reader.get_attribute('id') 7655 if value is not None: 7656 obj.id = value 7657 7658 # Discard the start tag: 7659 empty = reader.empty_element() 7660 reader.read() 7661 if empty: 7662 return obj 7663 7664 # Process the inner elements: 7665 links = [] 7666 while reader.forward(): 7667 tag = reader.node_name() 7668 if tag == 'capability': 7669 obj.capability = Reader.read_string(reader) 7670 elif tag == 'comment': 7671 obj.comment = Reader.read_string(reader) 7672 elif tag == 'description': 7673 obj.description = Reader.read_string(reader) 7674 elif tag == 'driver': 7675 obj.driver = Reader.read_string(reader) 7676 elif tag == 'host': 7677 obj.host = HostReader.read_one(reader) 7678 elif tag == 'iommu_group': 7679 obj.iommu_group = Reader.read_integer(reader) 7680 elif tag == 'm_dev_types': 7681 obj.m_dev_types = MDevTypeReader.read_many(reader) 7682 elif tag == 'name': 7683 obj.name = Reader.read_string(reader) 7684 elif tag == 'parent_device': 7685 obj.parent_device = HostDeviceReader.read_one(reader) 7686 elif tag == 'physical_function': 7687 obj.physical_function = HostDeviceReader.read_one(reader) 7688 elif tag == 'placeholder': 7689 obj.placeholder = Reader.read_boolean(reader) 7690 elif tag == 'product': 7691 obj.product = ProductReader.read_one(reader) 7692 elif tag == 'vendor': 7693 obj.vendor = VendorReader.read_one(reader) 7694 elif tag == 'virtual_functions': 7695 obj.virtual_functions = Reader.read_integer(reader) 7696 elif tag == 'vm': 7697 obj.vm = VmReader.read_one(reader) 7698 else: 7699 reader.next_element() 7700 for link in links: 7701 HostDeviceReader._process_link(link, obj) 7702 7703 # Discard the end tag: 7704 reader.read() 7705 7706 return obj 7707 7708 @staticmethod 7709 def read_many(reader): 7710 # Do nothing if there aren't more tags: 7711 objs = List() 7712 if not reader.forward(): 7713 return objs 7714 7715 # Process the attributes: 7716 objs.href = reader.get_attribute('href') 7717 7718 # Discard the start tag: 7719 empty = reader.empty_element() 7720 reader.read() 7721 if empty: 7722 return objs 7723 7724 # Process the inner elements: 7725 while reader.forward(): 7726 objs.append(HostDeviceReader.read_one(reader)) 7727 7728 # Discard the end tag: 7729 reader.read() 7730 7731 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7643 @staticmethod 7644 def read_one(reader): 7645 # Do nothing if there aren't more tags: 7646 if not reader.forward(): 7647 return None 7648 7649 # Create the object: 7650 obj = types.HostDevice() 7651 7652 # Process the attributes: 7653 obj.href = reader.get_attribute('href') 7654 value = reader.get_attribute('id') 7655 if value is not None: 7656 obj.id = value 7657 7658 # Discard the start tag: 7659 empty = reader.empty_element() 7660 reader.read() 7661 if empty: 7662 return obj 7663 7664 # Process the inner elements: 7665 links = [] 7666 while reader.forward(): 7667 tag = reader.node_name() 7668 if tag == 'capability': 7669 obj.capability = Reader.read_string(reader) 7670 elif tag == 'comment': 7671 obj.comment = Reader.read_string(reader) 7672 elif tag == 'description': 7673 obj.description = Reader.read_string(reader) 7674 elif tag == 'driver': 7675 obj.driver = Reader.read_string(reader) 7676 elif tag == 'host': 7677 obj.host = HostReader.read_one(reader) 7678 elif tag == 'iommu_group': 7679 obj.iommu_group = Reader.read_integer(reader) 7680 elif tag == 'm_dev_types': 7681 obj.m_dev_types = MDevTypeReader.read_many(reader) 7682 elif tag == 'name': 7683 obj.name = Reader.read_string(reader) 7684 elif tag == 'parent_device': 7685 obj.parent_device = HostDeviceReader.read_one(reader) 7686 elif tag == 'physical_function': 7687 obj.physical_function = HostDeviceReader.read_one(reader) 7688 elif tag == 'placeholder': 7689 obj.placeholder = Reader.read_boolean(reader) 7690 elif tag == 'product': 7691 obj.product = ProductReader.read_one(reader) 7692 elif tag == 'vendor': 7693 obj.vendor = VendorReader.read_one(reader) 7694 elif tag == 'virtual_functions': 7695 obj.virtual_functions = Reader.read_integer(reader) 7696 elif tag == 'vm': 7697 obj.vm = VmReader.read_one(reader) 7698 else: 7699 reader.next_element() 7700 for link in links: 7701 HostDeviceReader._process_link(link, obj) 7702 7703 # Discard the end tag: 7704 reader.read() 7705 7706 return obj
7708 @staticmethod 7709 def read_many(reader): 7710 # Do nothing if there aren't more tags: 7711 objs = List() 7712 if not reader.forward(): 7713 return objs 7714 7715 # Process the attributes: 7716 objs.href = reader.get_attribute('href') 7717 7718 # Discard the start tag: 7719 empty = reader.empty_element() 7720 reader.read() 7721 if empty: 7722 return objs 7723 7724 # Process the inner elements: 7725 while reader.forward(): 7726 objs.append(HostDeviceReader.read_one(reader)) 7727 7728 # Discard the end tag: 7729 reader.read() 7730 7731 return objs
7734class HostDevicePassthroughReader(Reader): 7735 7736 def __init__(self): 7737 super(HostDevicePassthroughReader, self).__init__() 7738 7739 @staticmethod 7740 def read_one(reader): 7741 # Do nothing if there aren't more tags: 7742 if not reader.forward(): 7743 return None 7744 7745 # Create the object: 7746 obj = types.HostDevicePassthrough() 7747 7748 # Process the attributes: 7749 obj.href = reader.get_attribute('href') 7750 7751 # Discard the start tag: 7752 empty = reader.empty_element() 7753 reader.read() 7754 if empty: 7755 return obj 7756 7757 # Process the inner elements: 7758 links = [] 7759 while reader.forward(): 7760 tag = reader.node_name() 7761 if tag == 'enabled': 7762 obj.enabled = Reader.read_boolean(reader) 7763 else: 7764 reader.next_element() 7765 for link in links: 7766 HostDevicePassthroughReader._process_link(link, obj) 7767 7768 # Discard the end tag: 7769 reader.read() 7770 7771 return obj 7772 7773 @staticmethod 7774 def read_many(reader): 7775 # Do nothing if there aren't more tags: 7776 objs = List() 7777 if not reader.forward(): 7778 return objs 7779 7780 # Process the attributes: 7781 objs.href = reader.get_attribute('href') 7782 7783 # Discard the start tag: 7784 empty = reader.empty_element() 7785 reader.read() 7786 if empty: 7787 return objs 7788 7789 # Process the inner elements: 7790 while reader.forward(): 7791 objs.append(HostDevicePassthroughReader.read_one(reader)) 7792 7793 # Discard the end tag: 7794 reader.read() 7795 7796 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7739 @staticmethod 7740 def read_one(reader): 7741 # Do nothing if there aren't more tags: 7742 if not reader.forward(): 7743 return None 7744 7745 # Create the object: 7746 obj = types.HostDevicePassthrough() 7747 7748 # Process the attributes: 7749 obj.href = reader.get_attribute('href') 7750 7751 # Discard the start tag: 7752 empty = reader.empty_element() 7753 reader.read() 7754 if empty: 7755 return obj 7756 7757 # Process the inner elements: 7758 links = [] 7759 while reader.forward(): 7760 tag = reader.node_name() 7761 if tag == 'enabled': 7762 obj.enabled = Reader.read_boolean(reader) 7763 else: 7764 reader.next_element() 7765 for link in links: 7766 HostDevicePassthroughReader._process_link(link, obj) 7767 7768 # Discard the end tag: 7769 reader.read() 7770 7771 return obj
7773 @staticmethod 7774 def read_many(reader): 7775 # Do nothing if there aren't more tags: 7776 objs = List() 7777 if not reader.forward(): 7778 return objs 7779 7780 # Process the attributes: 7781 objs.href = reader.get_attribute('href') 7782 7783 # Discard the start tag: 7784 empty = reader.empty_element() 7785 reader.read() 7786 if empty: 7787 return objs 7788 7789 # Process the inner elements: 7790 while reader.forward(): 7791 objs.append(HostDevicePassthroughReader.read_one(reader)) 7792 7793 # Discard the end tag: 7794 reader.read() 7795 7796 return objs
7799class HostNicReader(Reader): 7800 7801 def __init__(self): 7802 super(HostNicReader, self).__init__() 7803 7804 @staticmethod 7805 def read_one(reader): 7806 # Do nothing if there aren't more tags: 7807 if not reader.forward(): 7808 return None 7809 7810 # Create the object: 7811 obj = types.HostNic() 7812 7813 # Process the attributes: 7814 obj.href = reader.get_attribute('href') 7815 value = reader.get_attribute('id') 7816 if value is not None: 7817 obj.id = value 7818 7819 # Discard the start tag: 7820 empty = reader.empty_element() 7821 reader.read() 7822 if empty: 7823 return obj 7824 7825 # Process the inner elements: 7826 links = [] 7827 while reader.forward(): 7828 tag = reader.node_name() 7829 if tag == 'ad_aggregator_id': 7830 obj.ad_aggregator_id = Reader.read_integer(reader) 7831 elif tag == 'base_interface': 7832 obj.base_interface = Reader.read_string(reader) 7833 elif tag == 'bonding': 7834 obj.bonding = BondingReader.read_one(reader) 7835 elif tag == 'boot_protocol': 7836 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7837 elif tag == 'bridged': 7838 obj.bridged = Reader.read_boolean(reader) 7839 elif tag == 'check_connectivity': 7840 obj.check_connectivity = Reader.read_boolean(reader) 7841 elif tag == 'comment': 7842 obj.comment = Reader.read_string(reader) 7843 elif tag == 'custom_configuration': 7844 obj.custom_configuration = Reader.read_boolean(reader) 7845 elif tag == 'description': 7846 obj.description = Reader.read_string(reader) 7847 elif tag == 'host': 7848 obj.host = HostReader.read_one(reader) 7849 elif tag == 'ip': 7850 obj.ip = IpReader.read_one(reader) 7851 elif tag == 'ipv6': 7852 obj.ipv6 = IpReader.read_one(reader) 7853 elif tag == 'ipv6_boot_protocol': 7854 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7855 elif tag == 'mac': 7856 obj.mac = MacReader.read_one(reader) 7857 elif tag == 'mtu': 7858 obj.mtu = Reader.read_integer(reader) 7859 elif tag == 'name': 7860 obj.name = Reader.read_string(reader) 7861 elif tag == 'network': 7862 obj.network = NetworkReader.read_one(reader) 7863 elif tag == 'network_labels': 7864 obj.network_labels = NetworkLabelReader.read_many(reader) 7865 elif tag == 'override_configuration': 7866 obj.override_configuration = Reader.read_boolean(reader) 7867 elif tag == 'physical_function': 7868 obj.physical_function = HostNicReader.read_one(reader) 7869 elif tag == 'properties': 7870 obj.properties = PropertyReader.read_many(reader) 7871 elif tag == 'qos': 7872 obj.qos = QosReader.read_one(reader) 7873 elif tag == 'speed': 7874 obj.speed = Reader.read_integer(reader) 7875 elif tag == 'statistics': 7876 obj.statistics = StatisticReader.read_many(reader) 7877 elif tag == 'status': 7878 obj.status = Reader.read_enum(types.NicStatus, reader) 7879 elif tag == 'virtual_functions_configuration': 7880 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 7881 elif tag == 'vlan': 7882 obj.vlan = VlanReader.read_one(reader) 7883 elif tag == 'link': 7884 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7885 reader.next_element() 7886 else: 7887 reader.next_element() 7888 for link in links: 7889 HostNicReader._process_link(link, obj) 7890 7891 # Discard the end tag: 7892 reader.read() 7893 7894 return obj 7895 7896 @staticmethod 7897 def read_many(reader): 7898 # Do nothing if there aren't more tags: 7899 objs = List() 7900 if not reader.forward(): 7901 return objs 7902 7903 # Process the attributes: 7904 objs.href = reader.get_attribute('href') 7905 7906 # Discard the start tag: 7907 empty = reader.empty_element() 7908 reader.read() 7909 if empty: 7910 return objs 7911 7912 # Process the inner elements: 7913 while reader.forward(): 7914 objs.append(HostNicReader.read_one(reader)) 7915 7916 # Discard the end tag: 7917 reader.read() 7918 7919 return objs 7920 7921 @staticmethod 7922 def _process_link(link, obj): 7923 # Process the attributes: 7924 rel = link[0] 7925 href = link[1] 7926 if href and rel: 7927 if rel == "networklabels": 7928 if obj.network_labels is not None: 7929 obj.network_labels.href = href 7930 else: 7931 obj.network_labels = List(href) 7932 elif rel == "statistics": 7933 if obj.statistics is not None: 7934 obj.statistics.href = href 7935 else: 7936 obj.statistics = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7804 @staticmethod 7805 def read_one(reader): 7806 # Do nothing if there aren't more tags: 7807 if not reader.forward(): 7808 return None 7809 7810 # Create the object: 7811 obj = types.HostNic() 7812 7813 # Process the attributes: 7814 obj.href = reader.get_attribute('href') 7815 value = reader.get_attribute('id') 7816 if value is not None: 7817 obj.id = value 7818 7819 # Discard the start tag: 7820 empty = reader.empty_element() 7821 reader.read() 7822 if empty: 7823 return obj 7824 7825 # Process the inner elements: 7826 links = [] 7827 while reader.forward(): 7828 tag = reader.node_name() 7829 if tag == 'ad_aggregator_id': 7830 obj.ad_aggregator_id = Reader.read_integer(reader) 7831 elif tag == 'base_interface': 7832 obj.base_interface = Reader.read_string(reader) 7833 elif tag == 'bonding': 7834 obj.bonding = BondingReader.read_one(reader) 7835 elif tag == 'boot_protocol': 7836 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7837 elif tag == 'bridged': 7838 obj.bridged = Reader.read_boolean(reader) 7839 elif tag == 'check_connectivity': 7840 obj.check_connectivity = Reader.read_boolean(reader) 7841 elif tag == 'comment': 7842 obj.comment = Reader.read_string(reader) 7843 elif tag == 'custom_configuration': 7844 obj.custom_configuration = Reader.read_boolean(reader) 7845 elif tag == 'description': 7846 obj.description = Reader.read_string(reader) 7847 elif tag == 'host': 7848 obj.host = HostReader.read_one(reader) 7849 elif tag == 'ip': 7850 obj.ip = IpReader.read_one(reader) 7851 elif tag == 'ipv6': 7852 obj.ipv6 = IpReader.read_one(reader) 7853 elif tag == 'ipv6_boot_protocol': 7854 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 7855 elif tag == 'mac': 7856 obj.mac = MacReader.read_one(reader) 7857 elif tag == 'mtu': 7858 obj.mtu = Reader.read_integer(reader) 7859 elif tag == 'name': 7860 obj.name = Reader.read_string(reader) 7861 elif tag == 'network': 7862 obj.network = NetworkReader.read_one(reader) 7863 elif tag == 'network_labels': 7864 obj.network_labels = NetworkLabelReader.read_many(reader) 7865 elif tag == 'override_configuration': 7866 obj.override_configuration = Reader.read_boolean(reader) 7867 elif tag == 'physical_function': 7868 obj.physical_function = HostNicReader.read_one(reader) 7869 elif tag == 'properties': 7870 obj.properties = PropertyReader.read_many(reader) 7871 elif tag == 'qos': 7872 obj.qos = QosReader.read_one(reader) 7873 elif tag == 'speed': 7874 obj.speed = Reader.read_integer(reader) 7875 elif tag == 'statistics': 7876 obj.statistics = StatisticReader.read_many(reader) 7877 elif tag == 'status': 7878 obj.status = Reader.read_enum(types.NicStatus, reader) 7879 elif tag == 'virtual_functions_configuration': 7880 obj.virtual_functions_configuration = HostNicVirtualFunctionsConfigurationReader.read_one(reader) 7881 elif tag == 'vlan': 7882 obj.vlan = VlanReader.read_one(reader) 7883 elif tag == 'link': 7884 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 7885 reader.next_element() 7886 else: 7887 reader.next_element() 7888 for link in links: 7889 HostNicReader._process_link(link, obj) 7890 7891 # Discard the end tag: 7892 reader.read() 7893 7894 return obj
7896 @staticmethod 7897 def read_many(reader): 7898 # Do nothing if there aren't more tags: 7899 objs = List() 7900 if not reader.forward(): 7901 return objs 7902 7903 # Process the attributes: 7904 objs.href = reader.get_attribute('href') 7905 7906 # Discard the start tag: 7907 empty = reader.empty_element() 7908 reader.read() 7909 if empty: 7910 return objs 7911 7912 # Process the inner elements: 7913 while reader.forward(): 7914 objs.append(HostNicReader.read_one(reader)) 7915 7916 # Discard the end tag: 7917 reader.read() 7918 7919 return objs
7939class HostNicVirtualFunctionsConfigurationReader(Reader): 7940 7941 def __init__(self): 7942 super(HostNicVirtualFunctionsConfigurationReader, self).__init__() 7943 7944 @staticmethod 7945 def read_one(reader): 7946 # Do nothing if there aren't more tags: 7947 if not reader.forward(): 7948 return None 7949 7950 # Create the object: 7951 obj = types.HostNicVirtualFunctionsConfiguration() 7952 7953 # Process the attributes: 7954 obj.href = reader.get_attribute('href') 7955 7956 # Discard the start tag: 7957 empty = reader.empty_element() 7958 reader.read() 7959 if empty: 7960 return obj 7961 7962 # Process the inner elements: 7963 links = [] 7964 while reader.forward(): 7965 tag = reader.node_name() 7966 if tag == 'all_networks_allowed': 7967 obj.all_networks_allowed = Reader.read_boolean(reader) 7968 elif tag == 'max_number_of_virtual_functions': 7969 obj.max_number_of_virtual_functions = Reader.read_integer(reader) 7970 elif tag == 'number_of_virtual_functions': 7971 obj.number_of_virtual_functions = Reader.read_integer(reader) 7972 else: 7973 reader.next_element() 7974 for link in links: 7975 HostNicVirtualFunctionsConfigurationReader._process_link(link, obj) 7976 7977 # Discard the end tag: 7978 reader.read() 7979 7980 return obj 7981 7982 @staticmethod 7983 def read_many(reader): 7984 # Do nothing if there aren't more tags: 7985 objs = List() 7986 if not reader.forward(): 7987 return objs 7988 7989 # Process the attributes: 7990 objs.href = reader.get_attribute('href') 7991 7992 # Discard the start tag: 7993 empty = reader.empty_element() 7994 reader.read() 7995 if empty: 7996 return objs 7997 7998 # Process the inner elements: 7999 while reader.forward(): 8000 objs.append(HostNicVirtualFunctionsConfigurationReader.read_one(reader)) 8001 8002 # Discard the end tag: 8003 reader.read() 8004 8005 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
7944 @staticmethod 7945 def read_one(reader): 7946 # Do nothing if there aren't more tags: 7947 if not reader.forward(): 7948 return None 7949 7950 # Create the object: 7951 obj = types.HostNicVirtualFunctionsConfiguration() 7952 7953 # Process the attributes: 7954 obj.href = reader.get_attribute('href') 7955 7956 # Discard the start tag: 7957 empty = reader.empty_element() 7958 reader.read() 7959 if empty: 7960 return obj 7961 7962 # Process the inner elements: 7963 links = [] 7964 while reader.forward(): 7965 tag = reader.node_name() 7966 if tag == 'all_networks_allowed': 7967 obj.all_networks_allowed = Reader.read_boolean(reader) 7968 elif tag == 'max_number_of_virtual_functions': 7969 obj.max_number_of_virtual_functions = Reader.read_integer(reader) 7970 elif tag == 'number_of_virtual_functions': 7971 obj.number_of_virtual_functions = Reader.read_integer(reader) 7972 else: 7973 reader.next_element() 7974 for link in links: 7975 HostNicVirtualFunctionsConfigurationReader._process_link(link, obj) 7976 7977 # Discard the end tag: 7978 reader.read() 7979 7980 return obj
7982 @staticmethod 7983 def read_many(reader): 7984 # Do nothing if there aren't more tags: 7985 objs = List() 7986 if not reader.forward(): 7987 return objs 7988 7989 # Process the attributes: 7990 objs.href = reader.get_attribute('href') 7991 7992 # Discard the start tag: 7993 empty = reader.empty_element() 7994 reader.read() 7995 if empty: 7996 return objs 7997 7998 # Process the inner elements: 7999 while reader.forward(): 8000 objs.append(HostNicVirtualFunctionsConfigurationReader.read_one(reader)) 8001 8002 # Discard the end tag: 8003 reader.read() 8004 8005 return objs
8008class HostStorageReader(Reader): 8009 8010 def __init__(self): 8011 super(HostStorageReader, self).__init__() 8012 8013 @staticmethod 8014 def read_one(reader): 8015 # Do nothing if there aren't more tags: 8016 if not reader.forward(): 8017 return None 8018 8019 # Create the object: 8020 obj = types.HostStorage() 8021 8022 # Process the attributes: 8023 obj.href = reader.get_attribute('href') 8024 value = reader.get_attribute('id') 8025 if value is not None: 8026 obj.id = value 8027 8028 # Discard the start tag: 8029 empty = reader.empty_element() 8030 reader.read() 8031 if empty: 8032 return obj 8033 8034 # Process the inner elements: 8035 links = [] 8036 while reader.forward(): 8037 tag = reader.node_name() 8038 if tag == 'address': 8039 obj.address = Reader.read_string(reader) 8040 elif tag == 'comment': 8041 obj.comment = Reader.read_string(reader) 8042 elif tag == 'description': 8043 obj.description = Reader.read_string(reader) 8044 elif tag == 'driver_options': 8045 obj.driver_options = PropertyReader.read_many(reader) 8046 elif tag == 'driver_sensitive_options': 8047 obj.driver_sensitive_options = PropertyReader.read_many(reader) 8048 elif tag == 'host': 8049 obj.host = HostReader.read_one(reader) 8050 elif tag == 'logical_units': 8051 obj.logical_units = LogicalUnitReader.read_many(reader) 8052 elif tag == 'mount_options': 8053 obj.mount_options = Reader.read_string(reader) 8054 elif tag == 'name': 8055 obj.name = Reader.read_string(reader) 8056 elif tag == 'nfs_retrans': 8057 obj.nfs_retrans = Reader.read_integer(reader) 8058 elif tag == 'nfs_timeo': 8059 obj.nfs_timeo = Reader.read_integer(reader) 8060 elif tag == 'nfs_version': 8061 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 8062 elif tag == 'override_luns': 8063 obj.override_luns = Reader.read_boolean(reader) 8064 elif tag == 'password': 8065 obj.password = Reader.read_string(reader) 8066 elif tag == 'path': 8067 obj.path = Reader.read_string(reader) 8068 elif tag == 'port': 8069 obj.port = Reader.read_integer(reader) 8070 elif tag == 'portal': 8071 obj.portal = Reader.read_string(reader) 8072 elif tag == 'target': 8073 obj.target = Reader.read_string(reader) 8074 elif tag == 'type': 8075 obj.type = Reader.read_enum(types.StorageType, reader) 8076 elif tag == 'username': 8077 obj.username = Reader.read_string(reader) 8078 elif tag == 'vfs_type': 8079 obj.vfs_type = Reader.read_string(reader) 8080 elif tag == 'volume_group': 8081 obj.volume_group = VolumeGroupReader.read_one(reader) 8082 else: 8083 reader.next_element() 8084 for link in links: 8085 HostStorageReader._process_link(link, obj) 8086 8087 # Discard the end tag: 8088 reader.read() 8089 8090 return obj 8091 8092 @staticmethod 8093 def read_many(reader): 8094 # Do nothing if there aren't more tags: 8095 objs = List() 8096 if not reader.forward(): 8097 return objs 8098 8099 # Process the attributes: 8100 objs.href = reader.get_attribute('href') 8101 8102 # Discard the start tag: 8103 empty = reader.empty_element() 8104 reader.read() 8105 if empty: 8106 return objs 8107 8108 # Process the inner elements: 8109 while reader.forward(): 8110 objs.append(HostStorageReader.read_one(reader)) 8111 8112 # Discard the end tag: 8113 reader.read() 8114 8115 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8013 @staticmethod 8014 def read_one(reader): 8015 # Do nothing if there aren't more tags: 8016 if not reader.forward(): 8017 return None 8018 8019 # Create the object: 8020 obj = types.HostStorage() 8021 8022 # Process the attributes: 8023 obj.href = reader.get_attribute('href') 8024 value = reader.get_attribute('id') 8025 if value is not None: 8026 obj.id = value 8027 8028 # Discard the start tag: 8029 empty = reader.empty_element() 8030 reader.read() 8031 if empty: 8032 return obj 8033 8034 # Process the inner elements: 8035 links = [] 8036 while reader.forward(): 8037 tag = reader.node_name() 8038 if tag == 'address': 8039 obj.address = Reader.read_string(reader) 8040 elif tag == 'comment': 8041 obj.comment = Reader.read_string(reader) 8042 elif tag == 'description': 8043 obj.description = Reader.read_string(reader) 8044 elif tag == 'driver_options': 8045 obj.driver_options = PropertyReader.read_many(reader) 8046 elif tag == 'driver_sensitive_options': 8047 obj.driver_sensitive_options = PropertyReader.read_many(reader) 8048 elif tag == 'host': 8049 obj.host = HostReader.read_one(reader) 8050 elif tag == 'logical_units': 8051 obj.logical_units = LogicalUnitReader.read_many(reader) 8052 elif tag == 'mount_options': 8053 obj.mount_options = Reader.read_string(reader) 8054 elif tag == 'name': 8055 obj.name = Reader.read_string(reader) 8056 elif tag == 'nfs_retrans': 8057 obj.nfs_retrans = Reader.read_integer(reader) 8058 elif tag == 'nfs_timeo': 8059 obj.nfs_timeo = Reader.read_integer(reader) 8060 elif tag == 'nfs_version': 8061 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 8062 elif tag == 'override_luns': 8063 obj.override_luns = Reader.read_boolean(reader) 8064 elif tag == 'password': 8065 obj.password = Reader.read_string(reader) 8066 elif tag == 'path': 8067 obj.path = Reader.read_string(reader) 8068 elif tag == 'port': 8069 obj.port = Reader.read_integer(reader) 8070 elif tag == 'portal': 8071 obj.portal = Reader.read_string(reader) 8072 elif tag == 'target': 8073 obj.target = Reader.read_string(reader) 8074 elif tag == 'type': 8075 obj.type = Reader.read_enum(types.StorageType, reader) 8076 elif tag == 'username': 8077 obj.username = Reader.read_string(reader) 8078 elif tag == 'vfs_type': 8079 obj.vfs_type = Reader.read_string(reader) 8080 elif tag == 'volume_group': 8081 obj.volume_group = VolumeGroupReader.read_one(reader) 8082 else: 8083 reader.next_element() 8084 for link in links: 8085 HostStorageReader._process_link(link, obj) 8086 8087 # Discard the end tag: 8088 reader.read() 8089 8090 return obj
8092 @staticmethod 8093 def read_many(reader): 8094 # Do nothing if there aren't more tags: 8095 objs = List() 8096 if not reader.forward(): 8097 return objs 8098 8099 # Process the attributes: 8100 objs.href = reader.get_attribute('href') 8101 8102 # Discard the start tag: 8103 empty = reader.empty_element() 8104 reader.read() 8105 if empty: 8106 return objs 8107 8108 # Process the inner elements: 8109 while reader.forward(): 8110 objs.append(HostStorageReader.read_one(reader)) 8111 8112 # Discard the end tag: 8113 reader.read() 8114 8115 return objs
8118class HostedEngineReader(Reader): 8119 8120 def __init__(self): 8121 super(HostedEngineReader, self).__init__() 8122 8123 @staticmethod 8124 def read_one(reader): 8125 # Do nothing if there aren't more tags: 8126 if not reader.forward(): 8127 return None 8128 8129 # Create the object: 8130 obj = types.HostedEngine() 8131 8132 # Process the attributes: 8133 obj.href = reader.get_attribute('href') 8134 8135 # Discard the start tag: 8136 empty = reader.empty_element() 8137 reader.read() 8138 if empty: 8139 return obj 8140 8141 # Process the inner elements: 8142 links = [] 8143 while reader.forward(): 8144 tag = reader.node_name() 8145 if tag == 'active': 8146 obj.active = Reader.read_boolean(reader) 8147 elif tag == 'configured': 8148 obj.configured = Reader.read_boolean(reader) 8149 elif tag == 'global_maintenance': 8150 obj.global_maintenance = Reader.read_boolean(reader) 8151 elif tag == 'local_maintenance': 8152 obj.local_maintenance = Reader.read_boolean(reader) 8153 elif tag == 'score': 8154 obj.score = Reader.read_integer(reader) 8155 else: 8156 reader.next_element() 8157 for link in links: 8158 HostedEngineReader._process_link(link, obj) 8159 8160 # Discard the end tag: 8161 reader.read() 8162 8163 return obj 8164 8165 @staticmethod 8166 def read_many(reader): 8167 # Do nothing if there aren't more tags: 8168 objs = List() 8169 if not reader.forward(): 8170 return objs 8171 8172 # Process the attributes: 8173 objs.href = reader.get_attribute('href') 8174 8175 # Discard the start tag: 8176 empty = reader.empty_element() 8177 reader.read() 8178 if empty: 8179 return objs 8180 8181 # Process the inner elements: 8182 while reader.forward(): 8183 objs.append(HostedEngineReader.read_one(reader)) 8184 8185 # Discard the end tag: 8186 reader.read() 8187 8188 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8123 @staticmethod 8124 def read_one(reader): 8125 # Do nothing if there aren't more tags: 8126 if not reader.forward(): 8127 return None 8128 8129 # Create the object: 8130 obj = types.HostedEngine() 8131 8132 # Process the attributes: 8133 obj.href = reader.get_attribute('href') 8134 8135 # Discard the start tag: 8136 empty = reader.empty_element() 8137 reader.read() 8138 if empty: 8139 return obj 8140 8141 # Process the inner elements: 8142 links = [] 8143 while reader.forward(): 8144 tag = reader.node_name() 8145 if tag == 'active': 8146 obj.active = Reader.read_boolean(reader) 8147 elif tag == 'configured': 8148 obj.configured = Reader.read_boolean(reader) 8149 elif tag == 'global_maintenance': 8150 obj.global_maintenance = Reader.read_boolean(reader) 8151 elif tag == 'local_maintenance': 8152 obj.local_maintenance = Reader.read_boolean(reader) 8153 elif tag == 'score': 8154 obj.score = Reader.read_integer(reader) 8155 else: 8156 reader.next_element() 8157 for link in links: 8158 HostedEngineReader._process_link(link, obj) 8159 8160 # Discard the end tag: 8161 reader.read() 8162 8163 return obj
8165 @staticmethod 8166 def read_many(reader): 8167 # Do nothing if there aren't more tags: 8168 objs = List() 8169 if not reader.forward(): 8170 return objs 8171 8172 # Process the attributes: 8173 objs.href = reader.get_attribute('href') 8174 8175 # Discard the start tag: 8176 empty = reader.empty_element() 8177 reader.read() 8178 if empty: 8179 return objs 8180 8181 # Process the inner elements: 8182 while reader.forward(): 8183 objs.append(HostedEngineReader.read_one(reader)) 8184 8185 # Discard the end tag: 8186 reader.read() 8187 8188 return objs
8191class IconReader(Reader): 8192 8193 def __init__(self): 8194 super(IconReader, self).__init__() 8195 8196 @staticmethod 8197 def read_one(reader): 8198 # Do nothing if there aren't more tags: 8199 if not reader.forward(): 8200 return None 8201 8202 # Create the object: 8203 obj = types.Icon() 8204 8205 # Process the attributes: 8206 obj.href = reader.get_attribute('href') 8207 value = reader.get_attribute('id') 8208 if value is not None: 8209 obj.id = value 8210 8211 # Discard the start tag: 8212 empty = reader.empty_element() 8213 reader.read() 8214 if empty: 8215 return obj 8216 8217 # Process the inner elements: 8218 links = [] 8219 while reader.forward(): 8220 tag = reader.node_name() 8221 if tag == 'comment': 8222 obj.comment = Reader.read_string(reader) 8223 elif tag == 'data': 8224 obj.data = Reader.read_string(reader) 8225 elif tag == 'description': 8226 obj.description = Reader.read_string(reader) 8227 elif tag == 'media_type': 8228 obj.media_type = Reader.read_string(reader) 8229 elif tag == 'name': 8230 obj.name = Reader.read_string(reader) 8231 else: 8232 reader.next_element() 8233 for link in links: 8234 IconReader._process_link(link, obj) 8235 8236 # Discard the end tag: 8237 reader.read() 8238 8239 return obj 8240 8241 @staticmethod 8242 def read_many(reader): 8243 # Do nothing if there aren't more tags: 8244 objs = List() 8245 if not reader.forward(): 8246 return objs 8247 8248 # Process the attributes: 8249 objs.href = reader.get_attribute('href') 8250 8251 # Discard the start tag: 8252 empty = reader.empty_element() 8253 reader.read() 8254 if empty: 8255 return objs 8256 8257 # Process the inner elements: 8258 while reader.forward(): 8259 objs.append(IconReader.read_one(reader)) 8260 8261 # Discard the end tag: 8262 reader.read() 8263 8264 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8196 @staticmethod 8197 def read_one(reader): 8198 # Do nothing if there aren't more tags: 8199 if not reader.forward(): 8200 return None 8201 8202 # Create the object: 8203 obj = types.Icon() 8204 8205 # Process the attributes: 8206 obj.href = reader.get_attribute('href') 8207 value = reader.get_attribute('id') 8208 if value is not None: 8209 obj.id = value 8210 8211 # Discard the start tag: 8212 empty = reader.empty_element() 8213 reader.read() 8214 if empty: 8215 return obj 8216 8217 # Process the inner elements: 8218 links = [] 8219 while reader.forward(): 8220 tag = reader.node_name() 8221 if tag == 'comment': 8222 obj.comment = Reader.read_string(reader) 8223 elif tag == 'data': 8224 obj.data = Reader.read_string(reader) 8225 elif tag == 'description': 8226 obj.description = Reader.read_string(reader) 8227 elif tag == 'media_type': 8228 obj.media_type = Reader.read_string(reader) 8229 elif tag == 'name': 8230 obj.name = Reader.read_string(reader) 8231 else: 8232 reader.next_element() 8233 for link in links: 8234 IconReader._process_link(link, obj) 8235 8236 # Discard the end tag: 8237 reader.read() 8238 8239 return obj
8241 @staticmethod 8242 def read_many(reader): 8243 # Do nothing if there aren't more tags: 8244 objs = List() 8245 if not reader.forward(): 8246 return objs 8247 8248 # Process the attributes: 8249 objs.href = reader.get_attribute('href') 8250 8251 # Discard the start tag: 8252 empty = reader.empty_element() 8253 reader.read() 8254 if empty: 8255 return objs 8256 8257 # Process the inner elements: 8258 while reader.forward(): 8259 objs.append(IconReader.read_one(reader)) 8260 8261 # Discard the end tag: 8262 reader.read() 8263 8264 return objs
8267class IdentifiedReader(Reader): 8268 8269 def __init__(self): 8270 super(IdentifiedReader, self).__init__() 8271 8272 @staticmethod 8273 def read_one(reader): 8274 # Do nothing if there aren't more tags: 8275 if not reader.forward(): 8276 return None 8277 8278 # Create the object: 8279 obj = types.Identified() 8280 8281 # Process the attributes: 8282 obj.href = reader.get_attribute('href') 8283 value = reader.get_attribute('id') 8284 if value is not None: 8285 obj.id = value 8286 8287 # Discard the start tag: 8288 empty = reader.empty_element() 8289 reader.read() 8290 if empty: 8291 return obj 8292 8293 # Process the inner elements: 8294 links = [] 8295 while reader.forward(): 8296 tag = reader.node_name() 8297 if tag == 'comment': 8298 obj.comment = Reader.read_string(reader) 8299 elif tag == 'description': 8300 obj.description = Reader.read_string(reader) 8301 elif tag == 'name': 8302 obj.name = Reader.read_string(reader) 8303 else: 8304 reader.next_element() 8305 for link in links: 8306 IdentifiedReader._process_link(link, obj) 8307 8308 # Discard the end tag: 8309 reader.read() 8310 8311 return obj 8312 8313 @staticmethod 8314 def read_many(reader): 8315 # Do nothing if there aren't more tags: 8316 objs = List() 8317 if not reader.forward(): 8318 return objs 8319 8320 # Process the attributes: 8321 objs.href = reader.get_attribute('href') 8322 8323 # Discard the start tag: 8324 empty = reader.empty_element() 8325 reader.read() 8326 if empty: 8327 return objs 8328 8329 # Process the inner elements: 8330 while reader.forward(): 8331 objs.append(IdentifiedReader.read_one(reader)) 8332 8333 # Discard the end tag: 8334 reader.read() 8335 8336 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8272 @staticmethod 8273 def read_one(reader): 8274 # Do nothing if there aren't more tags: 8275 if not reader.forward(): 8276 return None 8277 8278 # Create the object: 8279 obj = types.Identified() 8280 8281 # Process the attributes: 8282 obj.href = reader.get_attribute('href') 8283 value = reader.get_attribute('id') 8284 if value is not None: 8285 obj.id = value 8286 8287 # Discard the start tag: 8288 empty = reader.empty_element() 8289 reader.read() 8290 if empty: 8291 return obj 8292 8293 # Process the inner elements: 8294 links = [] 8295 while reader.forward(): 8296 tag = reader.node_name() 8297 if tag == 'comment': 8298 obj.comment = Reader.read_string(reader) 8299 elif tag == 'description': 8300 obj.description = Reader.read_string(reader) 8301 elif tag == 'name': 8302 obj.name = Reader.read_string(reader) 8303 else: 8304 reader.next_element() 8305 for link in links: 8306 IdentifiedReader._process_link(link, obj) 8307 8308 # Discard the end tag: 8309 reader.read() 8310 8311 return obj
8313 @staticmethod 8314 def read_many(reader): 8315 # Do nothing if there aren't more tags: 8316 objs = List() 8317 if not reader.forward(): 8318 return objs 8319 8320 # Process the attributes: 8321 objs.href = reader.get_attribute('href') 8322 8323 # Discard the start tag: 8324 empty = reader.empty_element() 8325 reader.read() 8326 if empty: 8327 return objs 8328 8329 # Process the inner elements: 8330 while reader.forward(): 8331 objs.append(IdentifiedReader.read_one(reader)) 8332 8333 # Discard the end tag: 8334 reader.read() 8335 8336 return objs
8339class ImageReader(Reader): 8340 8341 def __init__(self): 8342 super(ImageReader, self).__init__() 8343 8344 @staticmethod 8345 def read_one(reader): 8346 # Do nothing if there aren't more tags: 8347 if not reader.forward(): 8348 return None 8349 8350 # Create the object: 8351 obj = types.Image() 8352 8353 # Process the attributes: 8354 obj.href = reader.get_attribute('href') 8355 value = reader.get_attribute('id') 8356 if value is not None: 8357 obj.id = value 8358 8359 # Discard the start tag: 8360 empty = reader.empty_element() 8361 reader.read() 8362 if empty: 8363 return obj 8364 8365 # Process the inner elements: 8366 links = [] 8367 while reader.forward(): 8368 tag = reader.node_name() 8369 if tag == 'comment': 8370 obj.comment = Reader.read_string(reader) 8371 elif tag == 'description': 8372 obj.description = Reader.read_string(reader) 8373 elif tag == 'name': 8374 obj.name = Reader.read_string(reader) 8375 elif tag == 'size': 8376 obj.size = Reader.read_integer(reader) 8377 elif tag == 'storage_domain': 8378 obj.storage_domain = StorageDomainReader.read_one(reader) 8379 elif tag == 'type': 8380 obj.type = Reader.read_enum(types.ImageFileType, reader) 8381 else: 8382 reader.next_element() 8383 for link in links: 8384 ImageReader._process_link(link, obj) 8385 8386 # Discard the end tag: 8387 reader.read() 8388 8389 return obj 8390 8391 @staticmethod 8392 def read_many(reader): 8393 # Do nothing if there aren't more tags: 8394 objs = List() 8395 if not reader.forward(): 8396 return objs 8397 8398 # Process the attributes: 8399 objs.href = reader.get_attribute('href') 8400 8401 # Discard the start tag: 8402 empty = reader.empty_element() 8403 reader.read() 8404 if empty: 8405 return objs 8406 8407 # Process the inner elements: 8408 while reader.forward(): 8409 objs.append(ImageReader.read_one(reader)) 8410 8411 # Discard the end tag: 8412 reader.read() 8413 8414 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8344 @staticmethod 8345 def read_one(reader): 8346 # Do nothing if there aren't more tags: 8347 if not reader.forward(): 8348 return None 8349 8350 # Create the object: 8351 obj = types.Image() 8352 8353 # Process the attributes: 8354 obj.href = reader.get_attribute('href') 8355 value = reader.get_attribute('id') 8356 if value is not None: 8357 obj.id = value 8358 8359 # Discard the start tag: 8360 empty = reader.empty_element() 8361 reader.read() 8362 if empty: 8363 return obj 8364 8365 # Process the inner elements: 8366 links = [] 8367 while reader.forward(): 8368 tag = reader.node_name() 8369 if tag == 'comment': 8370 obj.comment = Reader.read_string(reader) 8371 elif tag == 'description': 8372 obj.description = Reader.read_string(reader) 8373 elif tag == 'name': 8374 obj.name = Reader.read_string(reader) 8375 elif tag == 'size': 8376 obj.size = Reader.read_integer(reader) 8377 elif tag == 'storage_domain': 8378 obj.storage_domain = StorageDomainReader.read_one(reader) 8379 elif tag == 'type': 8380 obj.type = Reader.read_enum(types.ImageFileType, reader) 8381 else: 8382 reader.next_element() 8383 for link in links: 8384 ImageReader._process_link(link, obj) 8385 8386 # Discard the end tag: 8387 reader.read() 8388 8389 return obj
8391 @staticmethod 8392 def read_many(reader): 8393 # Do nothing if there aren't more tags: 8394 objs = List() 8395 if not reader.forward(): 8396 return objs 8397 8398 # Process the attributes: 8399 objs.href = reader.get_attribute('href') 8400 8401 # Discard the start tag: 8402 empty = reader.empty_element() 8403 reader.read() 8404 if empty: 8405 return objs 8406 8407 # Process the inner elements: 8408 while reader.forward(): 8409 objs.append(ImageReader.read_one(reader)) 8410 8411 # Discard the end tag: 8412 reader.read() 8413 8414 return objs
8417class ImageTransferReader(Reader): 8418 8419 def __init__(self): 8420 super(ImageTransferReader, self).__init__() 8421 8422 @staticmethod 8423 def read_one(reader): 8424 # Do nothing if there aren't more tags: 8425 if not reader.forward(): 8426 return None 8427 8428 # Create the object: 8429 obj = types.ImageTransfer() 8430 8431 # Process the attributes: 8432 obj.href = reader.get_attribute('href') 8433 value = reader.get_attribute('id') 8434 if value is not None: 8435 obj.id = value 8436 8437 # Discard the start tag: 8438 empty = reader.empty_element() 8439 reader.read() 8440 if empty: 8441 return obj 8442 8443 # Process the inner elements: 8444 links = [] 8445 while reader.forward(): 8446 tag = reader.node_name() 8447 if tag == 'active': 8448 obj.active = Reader.read_boolean(reader) 8449 elif tag == 'backup': 8450 obj.backup = BackupReader.read_one(reader) 8451 elif tag == 'comment': 8452 obj.comment = Reader.read_string(reader) 8453 elif tag == 'description': 8454 obj.description = Reader.read_string(reader) 8455 elif tag == 'direction': 8456 obj.direction = Reader.read_enum(types.ImageTransferDirection, reader) 8457 elif tag == 'disk': 8458 obj.disk = DiskReader.read_one(reader) 8459 elif tag == 'format': 8460 obj.format = Reader.read_enum(types.DiskFormat, reader) 8461 elif tag == 'host': 8462 obj.host = HostReader.read_one(reader) 8463 elif tag == 'image': 8464 obj.image = ImageReader.read_one(reader) 8465 elif tag == 'inactivity_timeout': 8466 obj.inactivity_timeout = Reader.read_integer(reader) 8467 elif tag == 'name': 8468 obj.name = Reader.read_string(reader) 8469 elif tag == 'phase': 8470 obj.phase = Reader.read_enum(types.ImageTransferPhase, reader) 8471 elif tag == 'proxy_url': 8472 obj.proxy_url = Reader.read_string(reader) 8473 elif tag == 'shallow': 8474 obj.shallow = Reader.read_boolean(reader) 8475 elif tag == 'snapshot': 8476 obj.snapshot = DiskSnapshotReader.read_one(reader) 8477 elif tag == 'timeout_policy': 8478 obj.timeout_policy = Reader.read_enum(types.ImageTransferTimeoutPolicy, reader) 8479 elif tag == 'transfer_url': 8480 obj.transfer_url = Reader.read_string(reader) 8481 elif tag == 'transferred': 8482 obj.transferred = Reader.read_integer(reader) 8483 else: 8484 reader.next_element() 8485 for link in links: 8486 ImageTransferReader._process_link(link, obj) 8487 8488 # Discard the end tag: 8489 reader.read() 8490 8491 return obj 8492 8493 @staticmethod 8494 def read_many(reader): 8495 # Do nothing if there aren't more tags: 8496 objs = List() 8497 if not reader.forward(): 8498 return objs 8499 8500 # Process the attributes: 8501 objs.href = reader.get_attribute('href') 8502 8503 # Discard the start tag: 8504 empty = reader.empty_element() 8505 reader.read() 8506 if empty: 8507 return objs 8508 8509 # Process the inner elements: 8510 while reader.forward(): 8511 objs.append(ImageTransferReader.read_one(reader)) 8512 8513 # Discard the end tag: 8514 reader.read() 8515 8516 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8422 @staticmethod 8423 def read_one(reader): 8424 # Do nothing if there aren't more tags: 8425 if not reader.forward(): 8426 return None 8427 8428 # Create the object: 8429 obj = types.ImageTransfer() 8430 8431 # Process the attributes: 8432 obj.href = reader.get_attribute('href') 8433 value = reader.get_attribute('id') 8434 if value is not None: 8435 obj.id = value 8436 8437 # Discard the start tag: 8438 empty = reader.empty_element() 8439 reader.read() 8440 if empty: 8441 return obj 8442 8443 # Process the inner elements: 8444 links = [] 8445 while reader.forward(): 8446 tag = reader.node_name() 8447 if tag == 'active': 8448 obj.active = Reader.read_boolean(reader) 8449 elif tag == 'backup': 8450 obj.backup = BackupReader.read_one(reader) 8451 elif tag == 'comment': 8452 obj.comment = Reader.read_string(reader) 8453 elif tag == 'description': 8454 obj.description = Reader.read_string(reader) 8455 elif tag == 'direction': 8456 obj.direction = Reader.read_enum(types.ImageTransferDirection, reader) 8457 elif tag == 'disk': 8458 obj.disk = DiskReader.read_one(reader) 8459 elif tag == 'format': 8460 obj.format = Reader.read_enum(types.DiskFormat, reader) 8461 elif tag == 'host': 8462 obj.host = HostReader.read_one(reader) 8463 elif tag == 'image': 8464 obj.image = ImageReader.read_one(reader) 8465 elif tag == 'inactivity_timeout': 8466 obj.inactivity_timeout = Reader.read_integer(reader) 8467 elif tag == 'name': 8468 obj.name = Reader.read_string(reader) 8469 elif tag == 'phase': 8470 obj.phase = Reader.read_enum(types.ImageTransferPhase, reader) 8471 elif tag == 'proxy_url': 8472 obj.proxy_url = Reader.read_string(reader) 8473 elif tag == 'shallow': 8474 obj.shallow = Reader.read_boolean(reader) 8475 elif tag == 'snapshot': 8476 obj.snapshot = DiskSnapshotReader.read_one(reader) 8477 elif tag == 'timeout_policy': 8478 obj.timeout_policy = Reader.read_enum(types.ImageTransferTimeoutPolicy, reader) 8479 elif tag == 'transfer_url': 8480 obj.transfer_url = Reader.read_string(reader) 8481 elif tag == 'transferred': 8482 obj.transferred = Reader.read_integer(reader) 8483 else: 8484 reader.next_element() 8485 for link in links: 8486 ImageTransferReader._process_link(link, obj) 8487 8488 # Discard the end tag: 8489 reader.read() 8490 8491 return obj
8493 @staticmethod 8494 def read_many(reader): 8495 # Do nothing if there aren't more tags: 8496 objs = List() 8497 if not reader.forward(): 8498 return objs 8499 8500 # Process the attributes: 8501 objs.href = reader.get_attribute('href') 8502 8503 # Discard the start tag: 8504 empty = reader.empty_element() 8505 reader.read() 8506 if empty: 8507 return objs 8508 8509 # Process the inner elements: 8510 while reader.forward(): 8511 objs.append(ImageTransferReader.read_one(reader)) 8512 8513 # Discard the end tag: 8514 reader.read() 8515 8516 return objs
8519class InitializationReader(Reader): 8520 8521 def __init__(self): 8522 super(InitializationReader, self).__init__() 8523 8524 @staticmethod 8525 def read_one(reader): 8526 # Do nothing if there aren't more tags: 8527 if not reader.forward(): 8528 return None 8529 8530 # Create the object: 8531 obj = types.Initialization() 8532 8533 # Process the attributes: 8534 obj.href = reader.get_attribute('href') 8535 8536 # Discard the start tag: 8537 empty = reader.empty_element() 8538 reader.read() 8539 if empty: 8540 return obj 8541 8542 # Process the inner elements: 8543 links = [] 8544 while reader.forward(): 8545 tag = reader.node_name() 8546 if tag == 'active_directory_ou': 8547 obj.active_directory_ou = Reader.read_string(reader) 8548 elif tag == 'authorized_ssh_keys': 8549 obj.authorized_ssh_keys = Reader.read_string(reader) 8550 elif tag == 'cloud_init': 8551 obj.cloud_init = CloudInitReader.read_one(reader) 8552 elif tag == 'cloud_init_network_protocol': 8553 obj.cloud_init_network_protocol = Reader.read_enum(types.CloudInitNetworkProtocol, reader) 8554 elif tag == 'configuration': 8555 obj.configuration = ConfigurationReader.read_one(reader) 8556 elif tag == 'custom_script': 8557 obj.custom_script = Reader.read_string(reader) 8558 elif tag == 'dns_search': 8559 obj.dns_search = Reader.read_string(reader) 8560 elif tag == 'dns_servers': 8561 obj.dns_servers = Reader.read_string(reader) 8562 elif tag == 'domain': 8563 obj.domain = Reader.read_string(reader) 8564 elif tag == 'host_name': 8565 obj.host_name = Reader.read_string(reader) 8566 elif tag == 'input_locale': 8567 obj.input_locale = Reader.read_string(reader) 8568 elif tag == 'nic_configurations': 8569 obj.nic_configurations = NicConfigurationReader.read_many(reader) 8570 elif tag == 'org_name': 8571 obj.org_name = Reader.read_string(reader) 8572 elif tag == 'regenerate_ids': 8573 obj.regenerate_ids = Reader.read_boolean(reader) 8574 elif tag == 'regenerate_ssh_keys': 8575 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 8576 elif tag == 'root_password': 8577 obj.root_password = Reader.read_string(reader) 8578 elif tag == 'system_locale': 8579 obj.system_locale = Reader.read_string(reader) 8580 elif tag == 'timezone': 8581 obj.timezone = Reader.read_string(reader) 8582 elif tag == 'ui_language': 8583 obj.ui_language = Reader.read_string(reader) 8584 elif tag == 'user_locale': 8585 obj.user_locale = Reader.read_string(reader) 8586 elif tag == 'user_name': 8587 obj.user_name = Reader.read_string(reader) 8588 elif tag == 'windows_license_key': 8589 obj.windows_license_key = Reader.read_string(reader) 8590 else: 8591 reader.next_element() 8592 for link in links: 8593 InitializationReader._process_link(link, obj) 8594 8595 # Discard the end tag: 8596 reader.read() 8597 8598 return obj 8599 8600 @staticmethod 8601 def read_many(reader): 8602 # Do nothing if there aren't more tags: 8603 objs = List() 8604 if not reader.forward(): 8605 return objs 8606 8607 # Process the attributes: 8608 objs.href = reader.get_attribute('href') 8609 8610 # Discard the start tag: 8611 empty = reader.empty_element() 8612 reader.read() 8613 if empty: 8614 return objs 8615 8616 # Process the inner elements: 8617 while reader.forward(): 8618 objs.append(InitializationReader.read_one(reader)) 8619 8620 # Discard the end tag: 8621 reader.read() 8622 8623 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8524 @staticmethod 8525 def read_one(reader): 8526 # Do nothing if there aren't more tags: 8527 if not reader.forward(): 8528 return None 8529 8530 # Create the object: 8531 obj = types.Initialization() 8532 8533 # Process the attributes: 8534 obj.href = reader.get_attribute('href') 8535 8536 # Discard the start tag: 8537 empty = reader.empty_element() 8538 reader.read() 8539 if empty: 8540 return obj 8541 8542 # Process the inner elements: 8543 links = [] 8544 while reader.forward(): 8545 tag = reader.node_name() 8546 if tag == 'active_directory_ou': 8547 obj.active_directory_ou = Reader.read_string(reader) 8548 elif tag == 'authorized_ssh_keys': 8549 obj.authorized_ssh_keys = Reader.read_string(reader) 8550 elif tag == 'cloud_init': 8551 obj.cloud_init = CloudInitReader.read_one(reader) 8552 elif tag == 'cloud_init_network_protocol': 8553 obj.cloud_init_network_protocol = Reader.read_enum(types.CloudInitNetworkProtocol, reader) 8554 elif tag == 'configuration': 8555 obj.configuration = ConfigurationReader.read_one(reader) 8556 elif tag == 'custom_script': 8557 obj.custom_script = Reader.read_string(reader) 8558 elif tag == 'dns_search': 8559 obj.dns_search = Reader.read_string(reader) 8560 elif tag == 'dns_servers': 8561 obj.dns_servers = Reader.read_string(reader) 8562 elif tag == 'domain': 8563 obj.domain = Reader.read_string(reader) 8564 elif tag == 'host_name': 8565 obj.host_name = Reader.read_string(reader) 8566 elif tag == 'input_locale': 8567 obj.input_locale = Reader.read_string(reader) 8568 elif tag == 'nic_configurations': 8569 obj.nic_configurations = NicConfigurationReader.read_many(reader) 8570 elif tag == 'org_name': 8571 obj.org_name = Reader.read_string(reader) 8572 elif tag == 'regenerate_ids': 8573 obj.regenerate_ids = Reader.read_boolean(reader) 8574 elif tag == 'regenerate_ssh_keys': 8575 obj.regenerate_ssh_keys = Reader.read_boolean(reader) 8576 elif tag == 'root_password': 8577 obj.root_password = Reader.read_string(reader) 8578 elif tag == 'system_locale': 8579 obj.system_locale = Reader.read_string(reader) 8580 elif tag == 'timezone': 8581 obj.timezone = Reader.read_string(reader) 8582 elif tag == 'ui_language': 8583 obj.ui_language = Reader.read_string(reader) 8584 elif tag == 'user_locale': 8585 obj.user_locale = Reader.read_string(reader) 8586 elif tag == 'user_name': 8587 obj.user_name = Reader.read_string(reader) 8588 elif tag == 'windows_license_key': 8589 obj.windows_license_key = Reader.read_string(reader) 8590 else: 8591 reader.next_element() 8592 for link in links: 8593 InitializationReader._process_link(link, obj) 8594 8595 # Discard the end tag: 8596 reader.read() 8597 8598 return obj
8600 @staticmethod 8601 def read_many(reader): 8602 # Do nothing if there aren't more tags: 8603 objs = List() 8604 if not reader.forward(): 8605 return objs 8606 8607 # Process the attributes: 8608 objs.href = reader.get_attribute('href') 8609 8610 # Discard the start tag: 8611 empty = reader.empty_element() 8612 reader.read() 8613 if empty: 8614 return objs 8615 8616 # Process the inner elements: 8617 while reader.forward(): 8618 objs.append(InitializationReader.read_one(reader)) 8619 8620 # Discard the end tag: 8621 reader.read() 8622 8623 return objs
8626class InstanceTypeReader(Reader): 8627 8628 def __init__(self): 8629 super(InstanceTypeReader, self).__init__() 8630 8631 @staticmethod 8632 def read_one(reader): 8633 # Do nothing if there aren't more tags: 8634 if not reader.forward(): 8635 return None 8636 8637 # Create the object: 8638 obj = types.InstanceType() 8639 8640 # Process the attributes: 8641 obj.href = reader.get_attribute('href') 8642 value = reader.get_attribute('id') 8643 if value is not None: 8644 obj.id = value 8645 8646 # Discard the start tag: 8647 empty = reader.empty_element() 8648 reader.read() 8649 if empty: 8650 return obj 8651 8652 # Process the inner elements: 8653 links = [] 8654 while reader.forward(): 8655 tag = reader.node_name() 8656 if tag == 'auto_pinning_policy': 8657 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 8658 elif tag == 'bios': 8659 obj.bios = BiosReader.read_one(reader) 8660 elif tag == 'cdroms': 8661 obj.cdroms = CdromReader.read_many(reader) 8662 elif tag == 'cluster': 8663 obj.cluster = ClusterReader.read_one(reader) 8664 elif tag == 'comment': 8665 obj.comment = Reader.read_string(reader) 8666 elif tag == 'console': 8667 obj.console = ConsoleReader.read_one(reader) 8668 elif tag == 'cpu': 8669 obj.cpu = CpuReader.read_one(reader) 8670 elif tag == 'cpu_pinning_policy': 8671 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 8672 elif tag == 'cpu_profile': 8673 obj.cpu_profile = CpuProfileReader.read_one(reader) 8674 elif tag == 'cpu_shares': 8675 obj.cpu_shares = Reader.read_integer(reader) 8676 elif tag == 'creation_time': 8677 obj.creation_time = Reader.read_date(reader) 8678 elif tag == 'custom_compatibility_version': 8679 obj.custom_compatibility_version = VersionReader.read_one(reader) 8680 elif tag == 'custom_cpu_model': 8681 obj.custom_cpu_model = Reader.read_string(reader) 8682 elif tag == 'custom_emulated_machine': 8683 obj.custom_emulated_machine = Reader.read_string(reader) 8684 elif tag == 'custom_properties': 8685 obj.custom_properties = CustomPropertyReader.read_many(reader) 8686 elif tag == 'delete_protected': 8687 obj.delete_protected = Reader.read_boolean(reader) 8688 elif tag == 'description': 8689 obj.description = Reader.read_string(reader) 8690 elif tag == 'disk_attachments': 8691 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 8692 elif tag == 'display': 8693 obj.display = DisplayReader.read_one(reader) 8694 elif tag == 'domain': 8695 obj.domain = DomainReader.read_one(reader) 8696 elif tag == 'graphics_consoles': 8697 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 8698 elif tag == 'high_availability': 8699 obj.high_availability = HighAvailabilityReader.read_one(reader) 8700 elif tag == 'initialization': 8701 obj.initialization = InitializationReader.read_one(reader) 8702 elif tag == 'io': 8703 obj.io = IoReader.read_one(reader) 8704 elif tag == 'large_icon': 8705 obj.large_icon = IconReader.read_one(reader) 8706 elif tag == 'lease': 8707 obj.lease = StorageDomainLeaseReader.read_one(reader) 8708 elif tag == 'mediated_devices': 8709 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 8710 elif tag == 'memory': 8711 obj.memory = Reader.read_integer(reader) 8712 elif tag == 'memory_policy': 8713 obj.memory_policy = MemoryPolicyReader.read_one(reader) 8714 elif tag == 'migration': 8715 obj.migration = MigrationOptionsReader.read_one(reader) 8716 elif tag == 'migration_downtime': 8717 obj.migration_downtime = Reader.read_integer(reader) 8718 elif tag == 'multi_queues_enabled': 8719 obj.multi_queues_enabled = Reader.read_boolean(reader) 8720 elif tag == 'name': 8721 obj.name = Reader.read_string(reader) 8722 elif tag == 'nics': 8723 obj.nics = NicReader.read_many(reader) 8724 elif tag == 'origin': 8725 obj.origin = Reader.read_string(reader) 8726 elif tag == 'os': 8727 obj.os = OperatingSystemReader.read_one(reader) 8728 elif tag == 'permissions': 8729 obj.permissions = PermissionReader.read_many(reader) 8730 elif tag == 'placement_policy': 8731 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 8732 elif tag == 'quota': 8733 obj.quota = QuotaReader.read_one(reader) 8734 elif tag == 'rng_device': 8735 obj.rng_device = RngDeviceReader.read_one(reader) 8736 elif tag == 'serial_number': 8737 obj.serial_number = SerialNumberReader.read_one(reader) 8738 elif tag == 'small_icon': 8739 obj.small_icon = IconReader.read_one(reader) 8740 elif tag == 'soundcard_enabled': 8741 obj.soundcard_enabled = Reader.read_boolean(reader) 8742 elif tag == 'sso': 8743 obj.sso = SsoReader.read_one(reader) 8744 elif tag == 'start_paused': 8745 obj.start_paused = Reader.read_boolean(reader) 8746 elif tag == 'stateless': 8747 obj.stateless = Reader.read_boolean(reader) 8748 elif tag == 'status': 8749 obj.status = Reader.read_enum(types.TemplateStatus, reader) 8750 elif tag == 'storage_domain': 8751 obj.storage_domain = StorageDomainReader.read_one(reader) 8752 elif tag == 'storage_error_resume_behaviour': 8753 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 8754 elif tag == 'tags': 8755 obj.tags = TagReader.read_many(reader) 8756 elif tag == 'time_zone': 8757 obj.time_zone = TimeZoneReader.read_one(reader) 8758 elif tag == 'tpm_enabled': 8759 obj.tpm_enabled = Reader.read_boolean(reader) 8760 elif tag == 'tunnel_migration': 8761 obj.tunnel_migration = Reader.read_boolean(reader) 8762 elif tag == 'type': 8763 obj.type = Reader.read_enum(types.VmType, reader) 8764 elif tag == 'usb': 8765 obj.usb = UsbReader.read_one(reader) 8766 elif tag == 'version': 8767 obj.version = TemplateVersionReader.read_one(reader) 8768 elif tag == 'virtio_scsi': 8769 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 8770 elif tag == 'virtio_scsi_multi_queues': 8771 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 8772 elif tag == 'virtio_scsi_multi_queues_enabled': 8773 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 8774 elif tag == 'vm': 8775 obj.vm = VmReader.read_one(reader) 8776 elif tag == 'watchdogs': 8777 obj.watchdogs = WatchdogReader.read_many(reader) 8778 elif tag == 'link': 8779 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 8780 reader.next_element() 8781 else: 8782 reader.next_element() 8783 for link in links: 8784 InstanceTypeReader._process_link(link, obj) 8785 8786 # Discard the end tag: 8787 reader.read() 8788 8789 return obj 8790 8791 @staticmethod 8792 def read_many(reader): 8793 # Do nothing if there aren't more tags: 8794 objs = List() 8795 if not reader.forward(): 8796 return objs 8797 8798 # Process the attributes: 8799 objs.href = reader.get_attribute('href') 8800 8801 # Discard the start tag: 8802 empty = reader.empty_element() 8803 reader.read() 8804 if empty: 8805 return objs 8806 8807 # Process the inner elements: 8808 while reader.forward(): 8809 objs.append(InstanceTypeReader.read_one(reader)) 8810 8811 # Discard the end tag: 8812 reader.read() 8813 8814 return objs 8815 8816 @staticmethod 8817 def _process_link(link, obj): 8818 # Process the attributes: 8819 rel = link[0] 8820 href = link[1] 8821 if href and rel: 8822 if rel == "cdroms": 8823 if obj.cdroms is not None: 8824 obj.cdroms.href = href 8825 else: 8826 obj.cdroms = List(href) 8827 elif rel == "diskattachments": 8828 if obj.disk_attachments is not None: 8829 obj.disk_attachments.href = href 8830 else: 8831 obj.disk_attachments = List(href) 8832 elif rel == "graphicsconsoles": 8833 if obj.graphics_consoles is not None: 8834 obj.graphics_consoles.href = href 8835 else: 8836 obj.graphics_consoles = List(href) 8837 elif rel == "mediateddevices": 8838 if obj.mediated_devices is not None: 8839 obj.mediated_devices.href = href 8840 else: 8841 obj.mediated_devices = List(href) 8842 elif rel == "nics": 8843 if obj.nics is not None: 8844 obj.nics.href = href 8845 else: 8846 obj.nics = List(href) 8847 elif rel == "permissions": 8848 if obj.permissions is not None: 8849 obj.permissions.href = href 8850 else: 8851 obj.permissions = List(href) 8852 elif rel == "tags": 8853 if obj.tags is not None: 8854 obj.tags.href = href 8855 else: 8856 obj.tags = List(href) 8857 elif rel == "watchdogs": 8858 if obj.watchdogs is not None: 8859 obj.watchdogs.href = href 8860 else: 8861 obj.watchdogs = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8631 @staticmethod 8632 def read_one(reader): 8633 # Do nothing if there aren't more tags: 8634 if not reader.forward(): 8635 return None 8636 8637 # Create the object: 8638 obj = types.InstanceType() 8639 8640 # Process the attributes: 8641 obj.href = reader.get_attribute('href') 8642 value = reader.get_attribute('id') 8643 if value is not None: 8644 obj.id = value 8645 8646 # Discard the start tag: 8647 empty = reader.empty_element() 8648 reader.read() 8649 if empty: 8650 return obj 8651 8652 # Process the inner elements: 8653 links = [] 8654 while reader.forward(): 8655 tag = reader.node_name() 8656 if tag == 'auto_pinning_policy': 8657 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 8658 elif tag == 'bios': 8659 obj.bios = BiosReader.read_one(reader) 8660 elif tag == 'cdroms': 8661 obj.cdroms = CdromReader.read_many(reader) 8662 elif tag == 'cluster': 8663 obj.cluster = ClusterReader.read_one(reader) 8664 elif tag == 'comment': 8665 obj.comment = Reader.read_string(reader) 8666 elif tag == 'console': 8667 obj.console = ConsoleReader.read_one(reader) 8668 elif tag == 'cpu': 8669 obj.cpu = CpuReader.read_one(reader) 8670 elif tag == 'cpu_pinning_policy': 8671 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 8672 elif tag == 'cpu_profile': 8673 obj.cpu_profile = CpuProfileReader.read_one(reader) 8674 elif tag == 'cpu_shares': 8675 obj.cpu_shares = Reader.read_integer(reader) 8676 elif tag == 'creation_time': 8677 obj.creation_time = Reader.read_date(reader) 8678 elif tag == 'custom_compatibility_version': 8679 obj.custom_compatibility_version = VersionReader.read_one(reader) 8680 elif tag == 'custom_cpu_model': 8681 obj.custom_cpu_model = Reader.read_string(reader) 8682 elif tag == 'custom_emulated_machine': 8683 obj.custom_emulated_machine = Reader.read_string(reader) 8684 elif tag == 'custom_properties': 8685 obj.custom_properties = CustomPropertyReader.read_many(reader) 8686 elif tag == 'delete_protected': 8687 obj.delete_protected = Reader.read_boolean(reader) 8688 elif tag == 'description': 8689 obj.description = Reader.read_string(reader) 8690 elif tag == 'disk_attachments': 8691 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 8692 elif tag == 'display': 8693 obj.display = DisplayReader.read_one(reader) 8694 elif tag == 'domain': 8695 obj.domain = DomainReader.read_one(reader) 8696 elif tag == 'graphics_consoles': 8697 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 8698 elif tag == 'high_availability': 8699 obj.high_availability = HighAvailabilityReader.read_one(reader) 8700 elif tag == 'initialization': 8701 obj.initialization = InitializationReader.read_one(reader) 8702 elif tag == 'io': 8703 obj.io = IoReader.read_one(reader) 8704 elif tag == 'large_icon': 8705 obj.large_icon = IconReader.read_one(reader) 8706 elif tag == 'lease': 8707 obj.lease = StorageDomainLeaseReader.read_one(reader) 8708 elif tag == 'mediated_devices': 8709 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 8710 elif tag == 'memory': 8711 obj.memory = Reader.read_integer(reader) 8712 elif tag == 'memory_policy': 8713 obj.memory_policy = MemoryPolicyReader.read_one(reader) 8714 elif tag == 'migration': 8715 obj.migration = MigrationOptionsReader.read_one(reader) 8716 elif tag == 'migration_downtime': 8717 obj.migration_downtime = Reader.read_integer(reader) 8718 elif tag == 'multi_queues_enabled': 8719 obj.multi_queues_enabled = Reader.read_boolean(reader) 8720 elif tag == 'name': 8721 obj.name = Reader.read_string(reader) 8722 elif tag == 'nics': 8723 obj.nics = NicReader.read_many(reader) 8724 elif tag == 'origin': 8725 obj.origin = Reader.read_string(reader) 8726 elif tag == 'os': 8727 obj.os = OperatingSystemReader.read_one(reader) 8728 elif tag == 'permissions': 8729 obj.permissions = PermissionReader.read_many(reader) 8730 elif tag == 'placement_policy': 8731 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 8732 elif tag == 'quota': 8733 obj.quota = QuotaReader.read_one(reader) 8734 elif tag == 'rng_device': 8735 obj.rng_device = RngDeviceReader.read_one(reader) 8736 elif tag == 'serial_number': 8737 obj.serial_number = SerialNumberReader.read_one(reader) 8738 elif tag == 'small_icon': 8739 obj.small_icon = IconReader.read_one(reader) 8740 elif tag == 'soundcard_enabled': 8741 obj.soundcard_enabled = Reader.read_boolean(reader) 8742 elif tag == 'sso': 8743 obj.sso = SsoReader.read_one(reader) 8744 elif tag == 'start_paused': 8745 obj.start_paused = Reader.read_boolean(reader) 8746 elif tag == 'stateless': 8747 obj.stateless = Reader.read_boolean(reader) 8748 elif tag == 'status': 8749 obj.status = Reader.read_enum(types.TemplateStatus, reader) 8750 elif tag == 'storage_domain': 8751 obj.storage_domain = StorageDomainReader.read_one(reader) 8752 elif tag == 'storage_error_resume_behaviour': 8753 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 8754 elif tag == 'tags': 8755 obj.tags = TagReader.read_many(reader) 8756 elif tag == 'time_zone': 8757 obj.time_zone = TimeZoneReader.read_one(reader) 8758 elif tag == 'tpm_enabled': 8759 obj.tpm_enabled = Reader.read_boolean(reader) 8760 elif tag == 'tunnel_migration': 8761 obj.tunnel_migration = Reader.read_boolean(reader) 8762 elif tag == 'type': 8763 obj.type = Reader.read_enum(types.VmType, reader) 8764 elif tag == 'usb': 8765 obj.usb = UsbReader.read_one(reader) 8766 elif tag == 'version': 8767 obj.version = TemplateVersionReader.read_one(reader) 8768 elif tag == 'virtio_scsi': 8769 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 8770 elif tag == 'virtio_scsi_multi_queues': 8771 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 8772 elif tag == 'virtio_scsi_multi_queues_enabled': 8773 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 8774 elif tag == 'vm': 8775 obj.vm = VmReader.read_one(reader) 8776 elif tag == 'watchdogs': 8777 obj.watchdogs = WatchdogReader.read_many(reader) 8778 elif tag == 'link': 8779 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 8780 reader.next_element() 8781 else: 8782 reader.next_element() 8783 for link in links: 8784 InstanceTypeReader._process_link(link, obj) 8785 8786 # Discard the end tag: 8787 reader.read() 8788 8789 return obj
8791 @staticmethod 8792 def read_many(reader): 8793 # Do nothing if there aren't more tags: 8794 objs = List() 8795 if not reader.forward(): 8796 return objs 8797 8798 # Process the attributes: 8799 objs.href = reader.get_attribute('href') 8800 8801 # Discard the start tag: 8802 empty = reader.empty_element() 8803 reader.read() 8804 if empty: 8805 return objs 8806 8807 # Process the inner elements: 8808 while reader.forward(): 8809 objs.append(InstanceTypeReader.read_one(reader)) 8810 8811 # Discard the end tag: 8812 reader.read() 8813 8814 return objs
8864class IoReader(Reader): 8865 8866 def __init__(self): 8867 super(IoReader, self).__init__() 8868 8869 @staticmethod 8870 def read_one(reader): 8871 # Do nothing if there aren't more tags: 8872 if not reader.forward(): 8873 return None 8874 8875 # Create the object: 8876 obj = types.Io() 8877 8878 # Process the attributes: 8879 obj.href = reader.get_attribute('href') 8880 8881 # Discard the start tag: 8882 empty = reader.empty_element() 8883 reader.read() 8884 if empty: 8885 return obj 8886 8887 # Process the inner elements: 8888 links = [] 8889 while reader.forward(): 8890 tag = reader.node_name() 8891 if tag == 'threads': 8892 obj.threads = Reader.read_integer(reader) 8893 else: 8894 reader.next_element() 8895 for link in links: 8896 IoReader._process_link(link, obj) 8897 8898 # Discard the end tag: 8899 reader.read() 8900 8901 return obj 8902 8903 @staticmethod 8904 def read_many(reader): 8905 # Do nothing if there aren't more tags: 8906 objs = List() 8907 if not reader.forward(): 8908 return objs 8909 8910 # Process the attributes: 8911 objs.href = reader.get_attribute('href') 8912 8913 # Discard the start tag: 8914 empty = reader.empty_element() 8915 reader.read() 8916 if empty: 8917 return objs 8918 8919 # Process the inner elements: 8920 while reader.forward(): 8921 objs.append(IoReader.read_one(reader)) 8922 8923 # Discard the end tag: 8924 reader.read() 8925 8926 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8869 @staticmethod 8870 def read_one(reader): 8871 # Do nothing if there aren't more tags: 8872 if not reader.forward(): 8873 return None 8874 8875 # Create the object: 8876 obj = types.Io() 8877 8878 # Process the attributes: 8879 obj.href = reader.get_attribute('href') 8880 8881 # Discard the start tag: 8882 empty = reader.empty_element() 8883 reader.read() 8884 if empty: 8885 return obj 8886 8887 # Process the inner elements: 8888 links = [] 8889 while reader.forward(): 8890 tag = reader.node_name() 8891 if tag == 'threads': 8892 obj.threads = Reader.read_integer(reader) 8893 else: 8894 reader.next_element() 8895 for link in links: 8896 IoReader._process_link(link, obj) 8897 8898 # Discard the end tag: 8899 reader.read() 8900 8901 return obj
8903 @staticmethod 8904 def read_many(reader): 8905 # Do nothing if there aren't more tags: 8906 objs = List() 8907 if not reader.forward(): 8908 return objs 8909 8910 # Process the attributes: 8911 objs.href = reader.get_attribute('href') 8912 8913 # Discard the start tag: 8914 empty = reader.empty_element() 8915 reader.read() 8916 if empty: 8917 return objs 8918 8919 # Process the inner elements: 8920 while reader.forward(): 8921 objs.append(IoReader.read_one(reader)) 8922 8923 # Discard the end tag: 8924 reader.read() 8925 8926 return objs
8929class IpReader(Reader): 8930 8931 def __init__(self): 8932 super(IpReader, self).__init__() 8933 8934 @staticmethod 8935 def read_one(reader): 8936 # Do nothing if there aren't more tags: 8937 if not reader.forward(): 8938 return None 8939 8940 # Create the object: 8941 obj = types.Ip() 8942 8943 # Process the attributes: 8944 obj.href = reader.get_attribute('href') 8945 8946 # Discard the start tag: 8947 empty = reader.empty_element() 8948 reader.read() 8949 if empty: 8950 return obj 8951 8952 # Process the inner elements: 8953 links = [] 8954 while reader.forward(): 8955 tag = reader.node_name() 8956 if tag == 'address': 8957 obj.address = Reader.read_string(reader) 8958 elif tag == 'gateway': 8959 obj.gateway = Reader.read_string(reader) 8960 elif tag == 'netmask': 8961 obj.netmask = Reader.read_string(reader) 8962 elif tag == 'version': 8963 obj.version = Reader.read_enum(types.IpVersion, reader) 8964 else: 8965 reader.next_element() 8966 for link in links: 8967 IpReader._process_link(link, obj) 8968 8969 # Discard the end tag: 8970 reader.read() 8971 8972 return obj 8973 8974 @staticmethod 8975 def read_many(reader): 8976 # Do nothing if there aren't more tags: 8977 objs = List() 8978 if not reader.forward(): 8979 return objs 8980 8981 # Process the attributes: 8982 objs.href = reader.get_attribute('href') 8983 8984 # Discard the start tag: 8985 empty = reader.empty_element() 8986 reader.read() 8987 if empty: 8988 return objs 8989 8990 # Process the inner elements: 8991 while reader.forward(): 8992 objs.append(IpReader.read_one(reader)) 8993 8994 # Discard the end tag: 8995 reader.read() 8996 8997 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
8934 @staticmethod 8935 def read_one(reader): 8936 # Do nothing if there aren't more tags: 8937 if not reader.forward(): 8938 return None 8939 8940 # Create the object: 8941 obj = types.Ip() 8942 8943 # Process the attributes: 8944 obj.href = reader.get_attribute('href') 8945 8946 # Discard the start tag: 8947 empty = reader.empty_element() 8948 reader.read() 8949 if empty: 8950 return obj 8951 8952 # Process the inner elements: 8953 links = [] 8954 while reader.forward(): 8955 tag = reader.node_name() 8956 if tag == 'address': 8957 obj.address = Reader.read_string(reader) 8958 elif tag == 'gateway': 8959 obj.gateway = Reader.read_string(reader) 8960 elif tag == 'netmask': 8961 obj.netmask = Reader.read_string(reader) 8962 elif tag == 'version': 8963 obj.version = Reader.read_enum(types.IpVersion, reader) 8964 else: 8965 reader.next_element() 8966 for link in links: 8967 IpReader._process_link(link, obj) 8968 8969 # Discard the end tag: 8970 reader.read() 8971 8972 return obj
8974 @staticmethod 8975 def read_many(reader): 8976 # Do nothing if there aren't more tags: 8977 objs = List() 8978 if not reader.forward(): 8979 return objs 8980 8981 # Process the attributes: 8982 objs.href = reader.get_attribute('href') 8983 8984 # Discard the start tag: 8985 empty = reader.empty_element() 8986 reader.read() 8987 if empty: 8988 return objs 8989 8990 # Process the inner elements: 8991 while reader.forward(): 8992 objs.append(IpReader.read_one(reader)) 8993 8994 # Discard the end tag: 8995 reader.read() 8996 8997 return objs
9000class IpAddressAssignmentReader(Reader): 9001 9002 def __init__(self): 9003 super(IpAddressAssignmentReader, self).__init__() 9004 9005 @staticmethod 9006 def read_one(reader): 9007 # Do nothing if there aren't more tags: 9008 if not reader.forward(): 9009 return None 9010 9011 # Create the object: 9012 obj = types.IpAddressAssignment() 9013 9014 # Process the attributes: 9015 obj.href = reader.get_attribute('href') 9016 9017 # Discard the start tag: 9018 empty = reader.empty_element() 9019 reader.read() 9020 if empty: 9021 return obj 9022 9023 # Process the inner elements: 9024 links = [] 9025 while reader.forward(): 9026 tag = reader.node_name() 9027 if tag == 'assignment_method': 9028 obj.assignment_method = Reader.read_enum(types.BootProtocol, reader) 9029 elif tag == 'ip': 9030 obj.ip = IpReader.read_one(reader) 9031 else: 9032 reader.next_element() 9033 for link in links: 9034 IpAddressAssignmentReader._process_link(link, obj) 9035 9036 # Discard the end tag: 9037 reader.read() 9038 9039 return obj 9040 9041 @staticmethod 9042 def read_many(reader): 9043 # Do nothing if there aren't more tags: 9044 objs = List() 9045 if not reader.forward(): 9046 return objs 9047 9048 # Process the attributes: 9049 objs.href = reader.get_attribute('href') 9050 9051 # Discard the start tag: 9052 empty = reader.empty_element() 9053 reader.read() 9054 if empty: 9055 return objs 9056 9057 # Process the inner elements: 9058 while reader.forward(): 9059 objs.append(IpAddressAssignmentReader.read_one(reader)) 9060 9061 # Discard the end tag: 9062 reader.read() 9063 9064 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9005 @staticmethod 9006 def read_one(reader): 9007 # Do nothing if there aren't more tags: 9008 if not reader.forward(): 9009 return None 9010 9011 # Create the object: 9012 obj = types.IpAddressAssignment() 9013 9014 # Process the attributes: 9015 obj.href = reader.get_attribute('href') 9016 9017 # Discard the start tag: 9018 empty = reader.empty_element() 9019 reader.read() 9020 if empty: 9021 return obj 9022 9023 # Process the inner elements: 9024 links = [] 9025 while reader.forward(): 9026 tag = reader.node_name() 9027 if tag == 'assignment_method': 9028 obj.assignment_method = Reader.read_enum(types.BootProtocol, reader) 9029 elif tag == 'ip': 9030 obj.ip = IpReader.read_one(reader) 9031 else: 9032 reader.next_element() 9033 for link in links: 9034 IpAddressAssignmentReader._process_link(link, obj) 9035 9036 # Discard the end tag: 9037 reader.read() 9038 9039 return obj
9041 @staticmethod 9042 def read_many(reader): 9043 # Do nothing if there aren't more tags: 9044 objs = List() 9045 if not reader.forward(): 9046 return objs 9047 9048 # Process the attributes: 9049 objs.href = reader.get_attribute('href') 9050 9051 # Discard the start tag: 9052 empty = reader.empty_element() 9053 reader.read() 9054 if empty: 9055 return objs 9056 9057 # Process the inner elements: 9058 while reader.forward(): 9059 objs.append(IpAddressAssignmentReader.read_one(reader)) 9060 9061 # Discard the end tag: 9062 reader.read() 9063 9064 return objs
9067class IscsiBondReader(Reader): 9068 9069 def __init__(self): 9070 super(IscsiBondReader, self).__init__() 9071 9072 @staticmethod 9073 def read_one(reader): 9074 # Do nothing if there aren't more tags: 9075 if not reader.forward(): 9076 return None 9077 9078 # Create the object: 9079 obj = types.IscsiBond() 9080 9081 # Process the attributes: 9082 obj.href = reader.get_attribute('href') 9083 value = reader.get_attribute('id') 9084 if value is not None: 9085 obj.id = value 9086 9087 # Discard the start tag: 9088 empty = reader.empty_element() 9089 reader.read() 9090 if empty: 9091 return obj 9092 9093 # Process the inner elements: 9094 links = [] 9095 while reader.forward(): 9096 tag = reader.node_name() 9097 if tag == 'comment': 9098 obj.comment = Reader.read_string(reader) 9099 elif tag == 'data_center': 9100 obj.data_center = DataCenterReader.read_one(reader) 9101 elif tag == 'description': 9102 obj.description = Reader.read_string(reader) 9103 elif tag == 'name': 9104 obj.name = Reader.read_string(reader) 9105 elif tag == 'networks': 9106 obj.networks = NetworkReader.read_many(reader) 9107 elif tag == 'storage_connections': 9108 obj.storage_connections = StorageConnectionReader.read_many(reader) 9109 elif tag == 'link': 9110 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9111 reader.next_element() 9112 else: 9113 reader.next_element() 9114 for link in links: 9115 IscsiBondReader._process_link(link, obj) 9116 9117 # Discard the end tag: 9118 reader.read() 9119 9120 return obj 9121 9122 @staticmethod 9123 def read_many(reader): 9124 # Do nothing if there aren't more tags: 9125 objs = List() 9126 if not reader.forward(): 9127 return objs 9128 9129 # Process the attributes: 9130 objs.href = reader.get_attribute('href') 9131 9132 # Discard the start tag: 9133 empty = reader.empty_element() 9134 reader.read() 9135 if empty: 9136 return objs 9137 9138 # Process the inner elements: 9139 while reader.forward(): 9140 objs.append(IscsiBondReader.read_one(reader)) 9141 9142 # Discard the end tag: 9143 reader.read() 9144 9145 return objs 9146 9147 @staticmethod 9148 def _process_link(link, obj): 9149 # Process the attributes: 9150 rel = link[0] 9151 href = link[1] 9152 if href and rel: 9153 if rel == "networks": 9154 if obj.networks is not None: 9155 obj.networks.href = href 9156 else: 9157 obj.networks = List(href) 9158 elif rel == "storageconnections": 9159 if obj.storage_connections is not None: 9160 obj.storage_connections.href = href 9161 else: 9162 obj.storage_connections = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9072 @staticmethod 9073 def read_one(reader): 9074 # Do nothing if there aren't more tags: 9075 if not reader.forward(): 9076 return None 9077 9078 # Create the object: 9079 obj = types.IscsiBond() 9080 9081 # Process the attributes: 9082 obj.href = reader.get_attribute('href') 9083 value = reader.get_attribute('id') 9084 if value is not None: 9085 obj.id = value 9086 9087 # Discard the start tag: 9088 empty = reader.empty_element() 9089 reader.read() 9090 if empty: 9091 return obj 9092 9093 # Process the inner elements: 9094 links = [] 9095 while reader.forward(): 9096 tag = reader.node_name() 9097 if tag == 'comment': 9098 obj.comment = Reader.read_string(reader) 9099 elif tag == 'data_center': 9100 obj.data_center = DataCenterReader.read_one(reader) 9101 elif tag == 'description': 9102 obj.description = Reader.read_string(reader) 9103 elif tag == 'name': 9104 obj.name = Reader.read_string(reader) 9105 elif tag == 'networks': 9106 obj.networks = NetworkReader.read_many(reader) 9107 elif tag == 'storage_connections': 9108 obj.storage_connections = StorageConnectionReader.read_many(reader) 9109 elif tag == 'link': 9110 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9111 reader.next_element() 9112 else: 9113 reader.next_element() 9114 for link in links: 9115 IscsiBondReader._process_link(link, obj) 9116 9117 # Discard the end tag: 9118 reader.read() 9119 9120 return obj
9122 @staticmethod 9123 def read_many(reader): 9124 # Do nothing if there aren't more tags: 9125 objs = List() 9126 if not reader.forward(): 9127 return objs 9128 9129 # Process the attributes: 9130 objs.href = reader.get_attribute('href') 9131 9132 # Discard the start tag: 9133 empty = reader.empty_element() 9134 reader.read() 9135 if empty: 9136 return objs 9137 9138 # Process the inner elements: 9139 while reader.forward(): 9140 objs.append(IscsiBondReader.read_one(reader)) 9141 9142 # Discard the end tag: 9143 reader.read() 9144 9145 return objs
9165class IscsiDetailsReader(Reader): 9166 9167 def __init__(self): 9168 super(IscsiDetailsReader, self).__init__() 9169 9170 @staticmethod 9171 def read_one(reader): 9172 # Do nothing if there aren't more tags: 9173 if not reader.forward(): 9174 return None 9175 9176 # Create the object: 9177 obj = types.IscsiDetails() 9178 9179 # Process the attributes: 9180 obj.href = reader.get_attribute('href') 9181 9182 # Discard the start tag: 9183 empty = reader.empty_element() 9184 reader.read() 9185 if empty: 9186 return obj 9187 9188 # Process the inner elements: 9189 links = [] 9190 while reader.forward(): 9191 tag = reader.node_name() 9192 if tag == 'address': 9193 obj.address = Reader.read_string(reader) 9194 elif tag == 'disk_id': 9195 obj.disk_id = Reader.read_string(reader) 9196 elif tag == 'initiator': 9197 obj.initiator = Reader.read_string(reader) 9198 elif tag == 'lun_mapping': 9199 obj.lun_mapping = Reader.read_integer(reader) 9200 elif tag == 'password': 9201 obj.password = Reader.read_string(reader) 9202 elif tag == 'paths': 9203 obj.paths = Reader.read_integer(reader) 9204 elif tag == 'port': 9205 obj.port = Reader.read_integer(reader) 9206 elif tag == 'portal': 9207 obj.portal = Reader.read_string(reader) 9208 elif tag == 'product_id': 9209 obj.product_id = Reader.read_string(reader) 9210 elif tag == 'serial': 9211 obj.serial = Reader.read_string(reader) 9212 elif tag == 'size': 9213 obj.size = Reader.read_integer(reader) 9214 elif tag == 'status': 9215 obj.status = Reader.read_string(reader) 9216 elif tag == 'storage_domain_id': 9217 obj.storage_domain_id = Reader.read_string(reader) 9218 elif tag == 'target': 9219 obj.target = Reader.read_string(reader) 9220 elif tag == 'username': 9221 obj.username = Reader.read_string(reader) 9222 elif tag == 'vendor_id': 9223 obj.vendor_id = Reader.read_string(reader) 9224 elif tag == 'volume_group_id': 9225 obj.volume_group_id = Reader.read_string(reader) 9226 else: 9227 reader.next_element() 9228 for link in links: 9229 IscsiDetailsReader._process_link(link, obj) 9230 9231 # Discard the end tag: 9232 reader.read() 9233 9234 return obj 9235 9236 @staticmethod 9237 def read_many(reader): 9238 # Do nothing if there aren't more tags: 9239 objs = List() 9240 if not reader.forward(): 9241 return objs 9242 9243 # Process the attributes: 9244 objs.href = reader.get_attribute('href') 9245 9246 # Discard the start tag: 9247 empty = reader.empty_element() 9248 reader.read() 9249 if empty: 9250 return objs 9251 9252 # Process the inner elements: 9253 while reader.forward(): 9254 objs.append(IscsiDetailsReader.read_one(reader)) 9255 9256 # Discard the end tag: 9257 reader.read() 9258 9259 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9170 @staticmethod 9171 def read_one(reader): 9172 # Do nothing if there aren't more tags: 9173 if not reader.forward(): 9174 return None 9175 9176 # Create the object: 9177 obj = types.IscsiDetails() 9178 9179 # Process the attributes: 9180 obj.href = reader.get_attribute('href') 9181 9182 # Discard the start tag: 9183 empty = reader.empty_element() 9184 reader.read() 9185 if empty: 9186 return obj 9187 9188 # Process the inner elements: 9189 links = [] 9190 while reader.forward(): 9191 tag = reader.node_name() 9192 if tag == 'address': 9193 obj.address = Reader.read_string(reader) 9194 elif tag == 'disk_id': 9195 obj.disk_id = Reader.read_string(reader) 9196 elif tag == 'initiator': 9197 obj.initiator = Reader.read_string(reader) 9198 elif tag == 'lun_mapping': 9199 obj.lun_mapping = Reader.read_integer(reader) 9200 elif tag == 'password': 9201 obj.password = Reader.read_string(reader) 9202 elif tag == 'paths': 9203 obj.paths = Reader.read_integer(reader) 9204 elif tag == 'port': 9205 obj.port = Reader.read_integer(reader) 9206 elif tag == 'portal': 9207 obj.portal = Reader.read_string(reader) 9208 elif tag == 'product_id': 9209 obj.product_id = Reader.read_string(reader) 9210 elif tag == 'serial': 9211 obj.serial = Reader.read_string(reader) 9212 elif tag == 'size': 9213 obj.size = Reader.read_integer(reader) 9214 elif tag == 'status': 9215 obj.status = Reader.read_string(reader) 9216 elif tag == 'storage_domain_id': 9217 obj.storage_domain_id = Reader.read_string(reader) 9218 elif tag == 'target': 9219 obj.target = Reader.read_string(reader) 9220 elif tag == 'username': 9221 obj.username = Reader.read_string(reader) 9222 elif tag == 'vendor_id': 9223 obj.vendor_id = Reader.read_string(reader) 9224 elif tag == 'volume_group_id': 9225 obj.volume_group_id = Reader.read_string(reader) 9226 else: 9227 reader.next_element() 9228 for link in links: 9229 IscsiDetailsReader._process_link(link, obj) 9230 9231 # Discard the end tag: 9232 reader.read() 9233 9234 return obj
9236 @staticmethod 9237 def read_many(reader): 9238 # Do nothing if there aren't more tags: 9239 objs = List() 9240 if not reader.forward(): 9241 return objs 9242 9243 # Process the attributes: 9244 objs.href = reader.get_attribute('href') 9245 9246 # Discard the start tag: 9247 empty = reader.empty_element() 9248 reader.read() 9249 if empty: 9250 return objs 9251 9252 # Process the inner elements: 9253 while reader.forward(): 9254 objs.append(IscsiDetailsReader.read_one(reader)) 9255 9256 # Discard the end tag: 9257 reader.read() 9258 9259 return objs
9262class JobReader(Reader): 9263 9264 def __init__(self): 9265 super(JobReader, self).__init__() 9266 9267 @staticmethod 9268 def read_one(reader): 9269 # Do nothing if there aren't more tags: 9270 if not reader.forward(): 9271 return None 9272 9273 # Create the object: 9274 obj = types.Job() 9275 9276 # Process the attributes: 9277 obj.href = reader.get_attribute('href') 9278 value = reader.get_attribute('id') 9279 if value is not None: 9280 obj.id = value 9281 9282 # Discard the start tag: 9283 empty = reader.empty_element() 9284 reader.read() 9285 if empty: 9286 return obj 9287 9288 # Process the inner elements: 9289 links = [] 9290 while reader.forward(): 9291 tag = reader.node_name() 9292 if tag == 'auto_cleared': 9293 obj.auto_cleared = Reader.read_boolean(reader) 9294 elif tag == 'comment': 9295 obj.comment = Reader.read_string(reader) 9296 elif tag == 'description': 9297 obj.description = Reader.read_string(reader) 9298 elif tag == 'end_time': 9299 obj.end_time = Reader.read_date(reader) 9300 elif tag == 'external': 9301 obj.external = Reader.read_boolean(reader) 9302 elif tag == 'last_updated': 9303 obj.last_updated = Reader.read_date(reader) 9304 elif tag == 'name': 9305 obj.name = Reader.read_string(reader) 9306 elif tag == 'owner': 9307 obj.owner = UserReader.read_one(reader) 9308 elif tag == 'start_time': 9309 obj.start_time = Reader.read_date(reader) 9310 elif tag == 'status': 9311 obj.status = Reader.read_enum(types.JobStatus, reader) 9312 elif tag == 'steps': 9313 obj.steps = StepReader.read_many(reader) 9314 elif tag == 'link': 9315 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9316 reader.next_element() 9317 else: 9318 reader.next_element() 9319 for link in links: 9320 JobReader._process_link(link, obj) 9321 9322 # Discard the end tag: 9323 reader.read() 9324 9325 return obj 9326 9327 @staticmethod 9328 def read_many(reader): 9329 # Do nothing if there aren't more tags: 9330 objs = List() 9331 if not reader.forward(): 9332 return objs 9333 9334 # Process the attributes: 9335 objs.href = reader.get_attribute('href') 9336 9337 # Discard the start tag: 9338 empty = reader.empty_element() 9339 reader.read() 9340 if empty: 9341 return objs 9342 9343 # Process the inner elements: 9344 while reader.forward(): 9345 objs.append(JobReader.read_one(reader)) 9346 9347 # Discard the end tag: 9348 reader.read() 9349 9350 return objs 9351 9352 @staticmethod 9353 def _process_link(link, obj): 9354 # Process the attributes: 9355 rel = link[0] 9356 href = link[1] 9357 if href and rel: 9358 if rel == "steps": 9359 if obj.steps is not None: 9360 obj.steps.href = href 9361 else: 9362 obj.steps = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9267 @staticmethod 9268 def read_one(reader): 9269 # Do nothing if there aren't more tags: 9270 if not reader.forward(): 9271 return None 9272 9273 # Create the object: 9274 obj = types.Job() 9275 9276 # Process the attributes: 9277 obj.href = reader.get_attribute('href') 9278 value = reader.get_attribute('id') 9279 if value is not None: 9280 obj.id = value 9281 9282 # Discard the start tag: 9283 empty = reader.empty_element() 9284 reader.read() 9285 if empty: 9286 return obj 9287 9288 # Process the inner elements: 9289 links = [] 9290 while reader.forward(): 9291 tag = reader.node_name() 9292 if tag == 'auto_cleared': 9293 obj.auto_cleared = Reader.read_boolean(reader) 9294 elif tag == 'comment': 9295 obj.comment = Reader.read_string(reader) 9296 elif tag == 'description': 9297 obj.description = Reader.read_string(reader) 9298 elif tag == 'end_time': 9299 obj.end_time = Reader.read_date(reader) 9300 elif tag == 'external': 9301 obj.external = Reader.read_boolean(reader) 9302 elif tag == 'last_updated': 9303 obj.last_updated = Reader.read_date(reader) 9304 elif tag == 'name': 9305 obj.name = Reader.read_string(reader) 9306 elif tag == 'owner': 9307 obj.owner = UserReader.read_one(reader) 9308 elif tag == 'start_time': 9309 obj.start_time = Reader.read_date(reader) 9310 elif tag == 'status': 9311 obj.status = Reader.read_enum(types.JobStatus, reader) 9312 elif tag == 'steps': 9313 obj.steps = StepReader.read_many(reader) 9314 elif tag == 'link': 9315 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9316 reader.next_element() 9317 else: 9318 reader.next_element() 9319 for link in links: 9320 JobReader._process_link(link, obj) 9321 9322 # Discard the end tag: 9323 reader.read() 9324 9325 return obj
9327 @staticmethod 9328 def read_many(reader): 9329 # Do nothing if there aren't more tags: 9330 objs = List() 9331 if not reader.forward(): 9332 return objs 9333 9334 # Process the attributes: 9335 objs.href = reader.get_attribute('href') 9336 9337 # Discard the start tag: 9338 empty = reader.empty_element() 9339 reader.read() 9340 if empty: 9341 return objs 9342 9343 # Process the inner elements: 9344 while reader.forward(): 9345 objs.append(JobReader.read_one(reader)) 9346 9347 # Discard the end tag: 9348 reader.read() 9349 9350 return objs
9365class KatelloErratumReader(Reader): 9366 9367 def __init__(self): 9368 super(KatelloErratumReader, self).__init__() 9369 9370 @staticmethod 9371 def read_one(reader): 9372 # Do nothing if there aren't more tags: 9373 if not reader.forward(): 9374 return None 9375 9376 # Create the object: 9377 obj = types.KatelloErratum() 9378 9379 # Process the attributes: 9380 obj.href = reader.get_attribute('href') 9381 value = reader.get_attribute('id') 9382 if value is not None: 9383 obj.id = value 9384 9385 # Discard the start tag: 9386 empty = reader.empty_element() 9387 reader.read() 9388 if empty: 9389 return obj 9390 9391 # Process the inner elements: 9392 links = [] 9393 while reader.forward(): 9394 tag = reader.node_name() 9395 if tag == 'comment': 9396 obj.comment = Reader.read_string(reader) 9397 elif tag == 'description': 9398 obj.description = Reader.read_string(reader) 9399 elif tag == 'host': 9400 obj.host = HostReader.read_one(reader) 9401 elif tag == 'issued': 9402 obj.issued = Reader.read_date(reader) 9403 elif tag == 'name': 9404 obj.name = Reader.read_string(reader) 9405 elif tag == 'packages': 9406 obj.packages = PackageReader.read_many(reader) 9407 elif tag == 'severity': 9408 obj.severity = Reader.read_string(reader) 9409 elif tag == 'solution': 9410 obj.solution = Reader.read_string(reader) 9411 elif tag == 'summary': 9412 obj.summary = Reader.read_string(reader) 9413 elif tag == 'title': 9414 obj.title = Reader.read_string(reader) 9415 elif tag == 'type': 9416 obj.type = Reader.read_string(reader) 9417 elif tag == 'vm': 9418 obj.vm = VmReader.read_one(reader) 9419 else: 9420 reader.next_element() 9421 for link in links: 9422 KatelloErratumReader._process_link(link, obj) 9423 9424 # Discard the end tag: 9425 reader.read() 9426 9427 return obj 9428 9429 @staticmethod 9430 def read_many(reader): 9431 # Do nothing if there aren't more tags: 9432 objs = List() 9433 if not reader.forward(): 9434 return objs 9435 9436 # Process the attributes: 9437 objs.href = reader.get_attribute('href') 9438 9439 # Discard the start tag: 9440 empty = reader.empty_element() 9441 reader.read() 9442 if empty: 9443 return objs 9444 9445 # Process the inner elements: 9446 while reader.forward(): 9447 objs.append(KatelloErratumReader.read_one(reader)) 9448 9449 # Discard the end tag: 9450 reader.read() 9451 9452 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9370 @staticmethod 9371 def read_one(reader): 9372 # Do nothing if there aren't more tags: 9373 if not reader.forward(): 9374 return None 9375 9376 # Create the object: 9377 obj = types.KatelloErratum() 9378 9379 # Process the attributes: 9380 obj.href = reader.get_attribute('href') 9381 value = reader.get_attribute('id') 9382 if value is not None: 9383 obj.id = value 9384 9385 # Discard the start tag: 9386 empty = reader.empty_element() 9387 reader.read() 9388 if empty: 9389 return obj 9390 9391 # Process the inner elements: 9392 links = [] 9393 while reader.forward(): 9394 tag = reader.node_name() 9395 if tag == 'comment': 9396 obj.comment = Reader.read_string(reader) 9397 elif tag == 'description': 9398 obj.description = Reader.read_string(reader) 9399 elif tag == 'host': 9400 obj.host = HostReader.read_one(reader) 9401 elif tag == 'issued': 9402 obj.issued = Reader.read_date(reader) 9403 elif tag == 'name': 9404 obj.name = Reader.read_string(reader) 9405 elif tag == 'packages': 9406 obj.packages = PackageReader.read_many(reader) 9407 elif tag == 'severity': 9408 obj.severity = Reader.read_string(reader) 9409 elif tag == 'solution': 9410 obj.solution = Reader.read_string(reader) 9411 elif tag == 'summary': 9412 obj.summary = Reader.read_string(reader) 9413 elif tag == 'title': 9414 obj.title = Reader.read_string(reader) 9415 elif tag == 'type': 9416 obj.type = Reader.read_string(reader) 9417 elif tag == 'vm': 9418 obj.vm = VmReader.read_one(reader) 9419 else: 9420 reader.next_element() 9421 for link in links: 9422 KatelloErratumReader._process_link(link, obj) 9423 9424 # Discard the end tag: 9425 reader.read() 9426 9427 return obj
9429 @staticmethod 9430 def read_many(reader): 9431 # Do nothing if there aren't more tags: 9432 objs = List() 9433 if not reader.forward(): 9434 return objs 9435 9436 # Process the attributes: 9437 objs.href = reader.get_attribute('href') 9438 9439 # Discard the start tag: 9440 empty = reader.empty_element() 9441 reader.read() 9442 if empty: 9443 return objs 9444 9445 # Process the inner elements: 9446 while reader.forward(): 9447 objs.append(KatelloErratumReader.read_one(reader)) 9448 9449 # Discard the end tag: 9450 reader.read() 9451 9452 return objs
9455class KernelReader(Reader): 9456 9457 def __init__(self): 9458 super(KernelReader, self).__init__() 9459 9460 @staticmethod 9461 def read_one(reader): 9462 # Do nothing if there aren't more tags: 9463 if not reader.forward(): 9464 return None 9465 9466 # Create the object: 9467 obj = types.Kernel() 9468 9469 # Process the attributes: 9470 obj.href = reader.get_attribute('href') 9471 9472 # Discard the start tag: 9473 empty = reader.empty_element() 9474 reader.read() 9475 if empty: 9476 return obj 9477 9478 # Process the inner elements: 9479 links = [] 9480 while reader.forward(): 9481 tag = reader.node_name() 9482 if tag == 'version': 9483 obj.version = VersionReader.read_one(reader) 9484 else: 9485 reader.next_element() 9486 for link in links: 9487 KernelReader._process_link(link, obj) 9488 9489 # Discard the end tag: 9490 reader.read() 9491 9492 return obj 9493 9494 @staticmethod 9495 def read_many(reader): 9496 # Do nothing if there aren't more tags: 9497 objs = List() 9498 if not reader.forward(): 9499 return objs 9500 9501 # Process the attributes: 9502 objs.href = reader.get_attribute('href') 9503 9504 # Discard the start tag: 9505 empty = reader.empty_element() 9506 reader.read() 9507 if empty: 9508 return objs 9509 9510 # Process the inner elements: 9511 while reader.forward(): 9512 objs.append(KernelReader.read_one(reader)) 9513 9514 # Discard the end tag: 9515 reader.read() 9516 9517 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9460 @staticmethod 9461 def read_one(reader): 9462 # Do nothing if there aren't more tags: 9463 if not reader.forward(): 9464 return None 9465 9466 # Create the object: 9467 obj = types.Kernel() 9468 9469 # Process the attributes: 9470 obj.href = reader.get_attribute('href') 9471 9472 # Discard the start tag: 9473 empty = reader.empty_element() 9474 reader.read() 9475 if empty: 9476 return obj 9477 9478 # Process the inner elements: 9479 links = [] 9480 while reader.forward(): 9481 tag = reader.node_name() 9482 if tag == 'version': 9483 obj.version = VersionReader.read_one(reader) 9484 else: 9485 reader.next_element() 9486 for link in links: 9487 KernelReader._process_link(link, obj) 9488 9489 # Discard the end tag: 9490 reader.read() 9491 9492 return obj
9494 @staticmethod 9495 def read_many(reader): 9496 # Do nothing if there aren't more tags: 9497 objs = List() 9498 if not reader.forward(): 9499 return objs 9500 9501 # Process the attributes: 9502 objs.href = reader.get_attribute('href') 9503 9504 # Discard the start tag: 9505 empty = reader.empty_element() 9506 reader.read() 9507 if empty: 9508 return objs 9509 9510 # Process the inner elements: 9511 while reader.forward(): 9512 objs.append(KernelReader.read_one(reader)) 9513 9514 # Discard the end tag: 9515 reader.read() 9516 9517 return objs
9520class KsmReader(Reader): 9521 9522 def __init__(self): 9523 super(KsmReader, self).__init__() 9524 9525 @staticmethod 9526 def read_one(reader): 9527 # Do nothing if there aren't more tags: 9528 if not reader.forward(): 9529 return None 9530 9531 # Create the object: 9532 obj = types.Ksm() 9533 9534 # Process the attributes: 9535 obj.href = reader.get_attribute('href') 9536 9537 # Discard the start tag: 9538 empty = reader.empty_element() 9539 reader.read() 9540 if empty: 9541 return obj 9542 9543 # Process the inner elements: 9544 links = [] 9545 while reader.forward(): 9546 tag = reader.node_name() 9547 if tag == 'enabled': 9548 obj.enabled = Reader.read_boolean(reader) 9549 elif tag == 'merge_across_nodes': 9550 obj.merge_across_nodes = Reader.read_boolean(reader) 9551 else: 9552 reader.next_element() 9553 for link in links: 9554 KsmReader._process_link(link, obj) 9555 9556 # Discard the end tag: 9557 reader.read() 9558 9559 return obj 9560 9561 @staticmethod 9562 def read_many(reader): 9563 # Do nothing if there aren't more tags: 9564 objs = List() 9565 if not reader.forward(): 9566 return objs 9567 9568 # Process the attributes: 9569 objs.href = reader.get_attribute('href') 9570 9571 # Discard the start tag: 9572 empty = reader.empty_element() 9573 reader.read() 9574 if empty: 9575 return objs 9576 9577 # Process the inner elements: 9578 while reader.forward(): 9579 objs.append(KsmReader.read_one(reader)) 9580 9581 # Discard the end tag: 9582 reader.read() 9583 9584 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9525 @staticmethod 9526 def read_one(reader): 9527 # Do nothing if there aren't more tags: 9528 if not reader.forward(): 9529 return None 9530 9531 # Create the object: 9532 obj = types.Ksm() 9533 9534 # Process the attributes: 9535 obj.href = reader.get_attribute('href') 9536 9537 # Discard the start tag: 9538 empty = reader.empty_element() 9539 reader.read() 9540 if empty: 9541 return obj 9542 9543 # Process the inner elements: 9544 links = [] 9545 while reader.forward(): 9546 tag = reader.node_name() 9547 if tag == 'enabled': 9548 obj.enabled = Reader.read_boolean(reader) 9549 elif tag == 'merge_across_nodes': 9550 obj.merge_across_nodes = Reader.read_boolean(reader) 9551 else: 9552 reader.next_element() 9553 for link in links: 9554 KsmReader._process_link(link, obj) 9555 9556 # Discard the end tag: 9557 reader.read() 9558 9559 return obj
9561 @staticmethod 9562 def read_many(reader): 9563 # Do nothing if there aren't more tags: 9564 objs = List() 9565 if not reader.forward(): 9566 return objs 9567 9568 # Process the attributes: 9569 objs.href = reader.get_attribute('href') 9570 9571 # Discard the start tag: 9572 empty = reader.empty_element() 9573 reader.read() 9574 if empty: 9575 return objs 9576 9577 # Process the inner elements: 9578 while reader.forward(): 9579 objs.append(KsmReader.read_one(reader)) 9580 9581 # Discard the end tag: 9582 reader.read() 9583 9584 return objs
9587class LinkLayerDiscoveryProtocolElementReader(Reader): 9588 9589 def __init__(self): 9590 super(LinkLayerDiscoveryProtocolElementReader, self).__init__() 9591 9592 @staticmethod 9593 def read_one(reader): 9594 # Do nothing if there aren't more tags: 9595 if not reader.forward(): 9596 return None 9597 9598 # Create the object: 9599 obj = types.LinkLayerDiscoveryProtocolElement() 9600 9601 # Process the attributes: 9602 obj.href = reader.get_attribute('href') 9603 value = reader.get_attribute('id') 9604 if value is not None: 9605 obj.id = value 9606 9607 # Discard the start tag: 9608 empty = reader.empty_element() 9609 reader.read() 9610 if empty: 9611 return obj 9612 9613 # Process the inner elements: 9614 links = [] 9615 while reader.forward(): 9616 tag = reader.node_name() 9617 if tag == 'comment': 9618 obj.comment = Reader.read_string(reader) 9619 elif tag == 'description': 9620 obj.description = Reader.read_string(reader) 9621 elif tag == 'name': 9622 obj.name = Reader.read_string(reader) 9623 elif tag == 'oui': 9624 obj.oui = Reader.read_integer(reader) 9625 elif tag == 'properties': 9626 obj.properties = PropertyReader.read_many(reader) 9627 elif tag == 'subtype': 9628 obj.subtype = Reader.read_integer(reader) 9629 elif tag == 'type': 9630 obj.type = Reader.read_integer(reader) 9631 else: 9632 reader.next_element() 9633 for link in links: 9634 LinkLayerDiscoveryProtocolElementReader._process_link(link, obj) 9635 9636 # Discard the end tag: 9637 reader.read() 9638 9639 return obj 9640 9641 @staticmethod 9642 def read_many(reader): 9643 # Do nothing if there aren't more tags: 9644 objs = List() 9645 if not reader.forward(): 9646 return objs 9647 9648 # Process the attributes: 9649 objs.href = reader.get_attribute('href') 9650 9651 # Discard the start tag: 9652 empty = reader.empty_element() 9653 reader.read() 9654 if empty: 9655 return objs 9656 9657 # Process the inner elements: 9658 while reader.forward(): 9659 objs.append(LinkLayerDiscoveryProtocolElementReader.read_one(reader)) 9660 9661 # Discard the end tag: 9662 reader.read() 9663 9664 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9592 @staticmethod 9593 def read_one(reader): 9594 # Do nothing if there aren't more tags: 9595 if not reader.forward(): 9596 return None 9597 9598 # Create the object: 9599 obj = types.LinkLayerDiscoveryProtocolElement() 9600 9601 # Process the attributes: 9602 obj.href = reader.get_attribute('href') 9603 value = reader.get_attribute('id') 9604 if value is not None: 9605 obj.id = value 9606 9607 # Discard the start tag: 9608 empty = reader.empty_element() 9609 reader.read() 9610 if empty: 9611 return obj 9612 9613 # Process the inner elements: 9614 links = [] 9615 while reader.forward(): 9616 tag = reader.node_name() 9617 if tag == 'comment': 9618 obj.comment = Reader.read_string(reader) 9619 elif tag == 'description': 9620 obj.description = Reader.read_string(reader) 9621 elif tag == 'name': 9622 obj.name = Reader.read_string(reader) 9623 elif tag == 'oui': 9624 obj.oui = Reader.read_integer(reader) 9625 elif tag == 'properties': 9626 obj.properties = PropertyReader.read_many(reader) 9627 elif tag == 'subtype': 9628 obj.subtype = Reader.read_integer(reader) 9629 elif tag == 'type': 9630 obj.type = Reader.read_integer(reader) 9631 else: 9632 reader.next_element() 9633 for link in links: 9634 LinkLayerDiscoveryProtocolElementReader._process_link(link, obj) 9635 9636 # Discard the end tag: 9637 reader.read() 9638 9639 return obj
9641 @staticmethod 9642 def read_many(reader): 9643 # Do nothing if there aren't more tags: 9644 objs = List() 9645 if not reader.forward(): 9646 return objs 9647 9648 # Process the attributes: 9649 objs.href = reader.get_attribute('href') 9650 9651 # Discard the start tag: 9652 empty = reader.empty_element() 9653 reader.read() 9654 if empty: 9655 return objs 9656 9657 # Process the inner elements: 9658 while reader.forward(): 9659 objs.append(LinkLayerDiscoveryProtocolElementReader.read_one(reader)) 9660 9661 # Discard the end tag: 9662 reader.read() 9663 9664 return objs
9667class LogicalUnitReader(Reader): 9668 9669 def __init__(self): 9670 super(LogicalUnitReader, self).__init__() 9671 9672 @staticmethod 9673 def read_one(reader): 9674 # Do nothing if there aren't more tags: 9675 if not reader.forward(): 9676 return None 9677 9678 # Create the object: 9679 obj = types.LogicalUnit() 9680 9681 # Process the attributes: 9682 obj.href = reader.get_attribute('href') 9683 value = reader.get_attribute('id') 9684 if value is not None: 9685 obj.id = value 9686 9687 # Discard the start tag: 9688 empty = reader.empty_element() 9689 reader.read() 9690 if empty: 9691 return obj 9692 9693 # Process the inner elements: 9694 links = [] 9695 while reader.forward(): 9696 tag = reader.node_name() 9697 if tag == 'address': 9698 obj.address = Reader.read_string(reader) 9699 elif tag == 'discard_max_size': 9700 obj.discard_max_size = Reader.read_integer(reader) 9701 elif tag == 'discard_zeroes_data': 9702 obj.discard_zeroes_data = Reader.read_boolean(reader) 9703 elif tag == 'disk_id': 9704 obj.disk_id = Reader.read_string(reader) 9705 elif tag == 'lun_mapping': 9706 obj.lun_mapping = Reader.read_integer(reader) 9707 elif tag == 'password': 9708 obj.password = Reader.read_string(reader) 9709 elif tag == 'paths': 9710 obj.paths = Reader.read_integer(reader) 9711 elif tag == 'port': 9712 obj.port = Reader.read_integer(reader) 9713 elif tag == 'portal': 9714 obj.portal = Reader.read_string(reader) 9715 elif tag == 'product_id': 9716 obj.product_id = Reader.read_string(reader) 9717 elif tag == 'serial': 9718 obj.serial = Reader.read_string(reader) 9719 elif tag == 'size': 9720 obj.size = Reader.read_integer(reader) 9721 elif tag == 'status': 9722 obj.status = Reader.read_enum(types.LunStatus, reader) 9723 elif tag == 'storage_domain_id': 9724 obj.storage_domain_id = Reader.read_string(reader) 9725 elif tag == 'target': 9726 obj.target = Reader.read_string(reader) 9727 elif tag == 'username': 9728 obj.username = Reader.read_string(reader) 9729 elif tag == 'vendor_id': 9730 obj.vendor_id = Reader.read_string(reader) 9731 elif tag == 'volume_group_id': 9732 obj.volume_group_id = Reader.read_string(reader) 9733 else: 9734 reader.next_element() 9735 for link in links: 9736 LogicalUnitReader._process_link(link, obj) 9737 9738 # Discard the end tag: 9739 reader.read() 9740 9741 return obj 9742 9743 @staticmethod 9744 def read_many(reader): 9745 # Do nothing if there aren't more tags: 9746 objs = List() 9747 if not reader.forward(): 9748 return objs 9749 9750 # Process the attributes: 9751 objs.href = reader.get_attribute('href') 9752 9753 # Discard the start tag: 9754 empty = reader.empty_element() 9755 reader.read() 9756 if empty: 9757 return objs 9758 9759 # Process the inner elements: 9760 while reader.forward(): 9761 objs.append(LogicalUnitReader.read_one(reader)) 9762 9763 # Discard the end tag: 9764 reader.read() 9765 9766 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9672 @staticmethod 9673 def read_one(reader): 9674 # Do nothing if there aren't more tags: 9675 if not reader.forward(): 9676 return None 9677 9678 # Create the object: 9679 obj = types.LogicalUnit() 9680 9681 # Process the attributes: 9682 obj.href = reader.get_attribute('href') 9683 value = reader.get_attribute('id') 9684 if value is not None: 9685 obj.id = value 9686 9687 # Discard the start tag: 9688 empty = reader.empty_element() 9689 reader.read() 9690 if empty: 9691 return obj 9692 9693 # Process the inner elements: 9694 links = [] 9695 while reader.forward(): 9696 tag = reader.node_name() 9697 if tag == 'address': 9698 obj.address = Reader.read_string(reader) 9699 elif tag == 'discard_max_size': 9700 obj.discard_max_size = Reader.read_integer(reader) 9701 elif tag == 'discard_zeroes_data': 9702 obj.discard_zeroes_data = Reader.read_boolean(reader) 9703 elif tag == 'disk_id': 9704 obj.disk_id = Reader.read_string(reader) 9705 elif tag == 'lun_mapping': 9706 obj.lun_mapping = Reader.read_integer(reader) 9707 elif tag == 'password': 9708 obj.password = Reader.read_string(reader) 9709 elif tag == 'paths': 9710 obj.paths = Reader.read_integer(reader) 9711 elif tag == 'port': 9712 obj.port = Reader.read_integer(reader) 9713 elif tag == 'portal': 9714 obj.portal = Reader.read_string(reader) 9715 elif tag == 'product_id': 9716 obj.product_id = Reader.read_string(reader) 9717 elif tag == 'serial': 9718 obj.serial = Reader.read_string(reader) 9719 elif tag == 'size': 9720 obj.size = Reader.read_integer(reader) 9721 elif tag == 'status': 9722 obj.status = Reader.read_enum(types.LunStatus, reader) 9723 elif tag == 'storage_domain_id': 9724 obj.storage_domain_id = Reader.read_string(reader) 9725 elif tag == 'target': 9726 obj.target = Reader.read_string(reader) 9727 elif tag == 'username': 9728 obj.username = Reader.read_string(reader) 9729 elif tag == 'vendor_id': 9730 obj.vendor_id = Reader.read_string(reader) 9731 elif tag == 'volume_group_id': 9732 obj.volume_group_id = Reader.read_string(reader) 9733 else: 9734 reader.next_element() 9735 for link in links: 9736 LogicalUnitReader._process_link(link, obj) 9737 9738 # Discard the end tag: 9739 reader.read() 9740 9741 return obj
9743 @staticmethod 9744 def read_many(reader): 9745 # Do nothing if there aren't more tags: 9746 objs = List() 9747 if not reader.forward(): 9748 return objs 9749 9750 # Process the attributes: 9751 objs.href = reader.get_attribute('href') 9752 9753 # Discard the start tag: 9754 empty = reader.empty_element() 9755 reader.read() 9756 if empty: 9757 return objs 9758 9759 # Process the inner elements: 9760 while reader.forward(): 9761 objs.append(LogicalUnitReader.read_one(reader)) 9762 9763 # Discard the end tag: 9764 reader.read() 9765 9766 return objs
9769class MDevTypeReader(Reader): 9770 9771 def __init__(self): 9772 super(MDevTypeReader, self).__init__() 9773 9774 @staticmethod 9775 def read_one(reader): 9776 # Do nothing if there aren't more tags: 9777 if not reader.forward(): 9778 return None 9779 9780 # Create the object: 9781 obj = types.MDevType() 9782 9783 # Process the attributes: 9784 obj.href = reader.get_attribute('href') 9785 9786 # Discard the start tag: 9787 empty = reader.empty_element() 9788 reader.read() 9789 if empty: 9790 return obj 9791 9792 # Process the inner elements: 9793 links = [] 9794 while reader.forward(): 9795 tag = reader.node_name() 9796 if tag == 'available_instances': 9797 obj.available_instances = Reader.read_integer(reader) 9798 elif tag == 'description': 9799 obj.description = Reader.read_string(reader) 9800 elif tag == 'human_readable_name': 9801 obj.human_readable_name = Reader.read_string(reader) 9802 elif tag == 'name': 9803 obj.name = Reader.read_string(reader) 9804 else: 9805 reader.next_element() 9806 for link in links: 9807 MDevTypeReader._process_link(link, obj) 9808 9809 # Discard the end tag: 9810 reader.read() 9811 9812 return obj 9813 9814 @staticmethod 9815 def read_many(reader): 9816 # Do nothing if there aren't more tags: 9817 objs = List() 9818 if not reader.forward(): 9819 return objs 9820 9821 # Process the attributes: 9822 objs.href = reader.get_attribute('href') 9823 9824 # Discard the start tag: 9825 empty = reader.empty_element() 9826 reader.read() 9827 if empty: 9828 return objs 9829 9830 # Process the inner elements: 9831 while reader.forward(): 9832 objs.append(MDevTypeReader.read_one(reader)) 9833 9834 # Discard the end tag: 9835 reader.read() 9836 9837 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9774 @staticmethod 9775 def read_one(reader): 9776 # Do nothing if there aren't more tags: 9777 if not reader.forward(): 9778 return None 9779 9780 # Create the object: 9781 obj = types.MDevType() 9782 9783 # Process the attributes: 9784 obj.href = reader.get_attribute('href') 9785 9786 # Discard the start tag: 9787 empty = reader.empty_element() 9788 reader.read() 9789 if empty: 9790 return obj 9791 9792 # Process the inner elements: 9793 links = [] 9794 while reader.forward(): 9795 tag = reader.node_name() 9796 if tag == 'available_instances': 9797 obj.available_instances = Reader.read_integer(reader) 9798 elif tag == 'description': 9799 obj.description = Reader.read_string(reader) 9800 elif tag == 'human_readable_name': 9801 obj.human_readable_name = Reader.read_string(reader) 9802 elif tag == 'name': 9803 obj.name = Reader.read_string(reader) 9804 else: 9805 reader.next_element() 9806 for link in links: 9807 MDevTypeReader._process_link(link, obj) 9808 9809 # Discard the end tag: 9810 reader.read() 9811 9812 return obj
9814 @staticmethod 9815 def read_many(reader): 9816 # Do nothing if there aren't more tags: 9817 objs = List() 9818 if not reader.forward(): 9819 return objs 9820 9821 # Process the attributes: 9822 objs.href = reader.get_attribute('href') 9823 9824 # Discard the start tag: 9825 empty = reader.empty_element() 9826 reader.read() 9827 if empty: 9828 return objs 9829 9830 # Process the inner elements: 9831 while reader.forward(): 9832 objs.append(MDevTypeReader.read_one(reader)) 9833 9834 # Discard the end tag: 9835 reader.read() 9836 9837 return objs
9840class MacReader(Reader): 9841 9842 def __init__(self): 9843 super(MacReader, self).__init__() 9844 9845 @staticmethod 9846 def read_one(reader): 9847 # Do nothing if there aren't more tags: 9848 if not reader.forward(): 9849 return None 9850 9851 # Create the object: 9852 obj = types.Mac() 9853 9854 # Process the attributes: 9855 obj.href = reader.get_attribute('href') 9856 9857 # Discard the start tag: 9858 empty = reader.empty_element() 9859 reader.read() 9860 if empty: 9861 return obj 9862 9863 # Process the inner elements: 9864 links = [] 9865 while reader.forward(): 9866 tag = reader.node_name() 9867 if tag == 'address': 9868 obj.address = Reader.read_string(reader) 9869 else: 9870 reader.next_element() 9871 for link in links: 9872 MacReader._process_link(link, obj) 9873 9874 # Discard the end tag: 9875 reader.read() 9876 9877 return obj 9878 9879 @staticmethod 9880 def read_many(reader): 9881 # Do nothing if there aren't more tags: 9882 objs = List() 9883 if not reader.forward(): 9884 return objs 9885 9886 # Process the attributes: 9887 objs.href = reader.get_attribute('href') 9888 9889 # Discard the start tag: 9890 empty = reader.empty_element() 9891 reader.read() 9892 if empty: 9893 return objs 9894 9895 # Process the inner elements: 9896 while reader.forward(): 9897 objs.append(MacReader.read_one(reader)) 9898 9899 # Discard the end tag: 9900 reader.read() 9901 9902 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9845 @staticmethod 9846 def read_one(reader): 9847 # Do nothing if there aren't more tags: 9848 if not reader.forward(): 9849 return None 9850 9851 # Create the object: 9852 obj = types.Mac() 9853 9854 # Process the attributes: 9855 obj.href = reader.get_attribute('href') 9856 9857 # Discard the start tag: 9858 empty = reader.empty_element() 9859 reader.read() 9860 if empty: 9861 return obj 9862 9863 # Process the inner elements: 9864 links = [] 9865 while reader.forward(): 9866 tag = reader.node_name() 9867 if tag == 'address': 9868 obj.address = Reader.read_string(reader) 9869 else: 9870 reader.next_element() 9871 for link in links: 9872 MacReader._process_link(link, obj) 9873 9874 # Discard the end tag: 9875 reader.read() 9876 9877 return obj
9879 @staticmethod 9880 def read_many(reader): 9881 # Do nothing if there aren't more tags: 9882 objs = List() 9883 if not reader.forward(): 9884 return objs 9885 9886 # Process the attributes: 9887 objs.href = reader.get_attribute('href') 9888 9889 # Discard the start tag: 9890 empty = reader.empty_element() 9891 reader.read() 9892 if empty: 9893 return objs 9894 9895 # Process the inner elements: 9896 while reader.forward(): 9897 objs.append(MacReader.read_one(reader)) 9898 9899 # Discard the end tag: 9900 reader.read() 9901 9902 return objs
9905class MacPoolReader(Reader): 9906 9907 def __init__(self): 9908 super(MacPoolReader, self).__init__() 9909 9910 @staticmethod 9911 def read_one(reader): 9912 # Do nothing if there aren't more tags: 9913 if not reader.forward(): 9914 return None 9915 9916 # Create the object: 9917 obj = types.MacPool() 9918 9919 # Process the attributes: 9920 obj.href = reader.get_attribute('href') 9921 value = reader.get_attribute('id') 9922 if value is not None: 9923 obj.id = value 9924 9925 # Discard the start tag: 9926 empty = reader.empty_element() 9927 reader.read() 9928 if empty: 9929 return obj 9930 9931 # Process the inner elements: 9932 links = [] 9933 while reader.forward(): 9934 tag = reader.node_name() 9935 if tag == 'allow_duplicates': 9936 obj.allow_duplicates = Reader.read_boolean(reader) 9937 elif tag == 'comment': 9938 obj.comment = Reader.read_string(reader) 9939 elif tag == 'default_pool': 9940 obj.default_pool = Reader.read_boolean(reader) 9941 elif tag == 'description': 9942 obj.description = Reader.read_string(reader) 9943 elif tag == 'name': 9944 obj.name = Reader.read_string(reader) 9945 elif tag == 'permissions': 9946 obj.permissions = PermissionReader.read_many(reader) 9947 elif tag == 'ranges': 9948 obj.ranges = RangeReader.read_many(reader) 9949 elif tag == 'link': 9950 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9951 reader.next_element() 9952 else: 9953 reader.next_element() 9954 for link in links: 9955 MacPoolReader._process_link(link, obj) 9956 9957 # Discard the end tag: 9958 reader.read() 9959 9960 return obj 9961 9962 @staticmethod 9963 def read_many(reader): 9964 # Do nothing if there aren't more tags: 9965 objs = List() 9966 if not reader.forward(): 9967 return objs 9968 9969 # Process the attributes: 9970 objs.href = reader.get_attribute('href') 9971 9972 # Discard the start tag: 9973 empty = reader.empty_element() 9974 reader.read() 9975 if empty: 9976 return objs 9977 9978 # Process the inner elements: 9979 while reader.forward(): 9980 objs.append(MacPoolReader.read_one(reader)) 9981 9982 # Discard the end tag: 9983 reader.read() 9984 9985 return objs 9986 9987 @staticmethod 9988 def _process_link(link, obj): 9989 # Process the attributes: 9990 rel = link[0] 9991 href = link[1] 9992 if href and rel: 9993 if rel == "permissions": 9994 if obj.permissions is not None: 9995 obj.permissions.href = href 9996 else: 9997 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
9910 @staticmethod 9911 def read_one(reader): 9912 # Do nothing if there aren't more tags: 9913 if not reader.forward(): 9914 return None 9915 9916 # Create the object: 9917 obj = types.MacPool() 9918 9919 # Process the attributes: 9920 obj.href = reader.get_attribute('href') 9921 value = reader.get_attribute('id') 9922 if value is not None: 9923 obj.id = value 9924 9925 # Discard the start tag: 9926 empty = reader.empty_element() 9927 reader.read() 9928 if empty: 9929 return obj 9930 9931 # Process the inner elements: 9932 links = [] 9933 while reader.forward(): 9934 tag = reader.node_name() 9935 if tag == 'allow_duplicates': 9936 obj.allow_duplicates = Reader.read_boolean(reader) 9937 elif tag == 'comment': 9938 obj.comment = Reader.read_string(reader) 9939 elif tag == 'default_pool': 9940 obj.default_pool = Reader.read_boolean(reader) 9941 elif tag == 'description': 9942 obj.description = Reader.read_string(reader) 9943 elif tag == 'name': 9944 obj.name = Reader.read_string(reader) 9945 elif tag == 'permissions': 9946 obj.permissions = PermissionReader.read_many(reader) 9947 elif tag == 'ranges': 9948 obj.ranges = RangeReader.read_many(reader) 9949 elif tag == 'link': 9950 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 9951 reader.next_element() 9952 else: 9953 reader.next_element() 9954 for link in links: 9955 MacPoolReader._process_link(link, obj) 9956 9957 # Discard the end tag: 9958 reader.read() 9959 9960 return obj
9962 @staticmethod 9963 def read_many(reader): 9964 # Do nothing if there aren't more tags: 9965 objs = List() 9966 if not reader.forward(): 9967 return objs 9968 9969 # Process the attributes: 9970 objs.href = reader.get_attribute('href') 9971 9972 # Discard the start tag: 9973 empty = reader.empty_element() 9974 reader.read() 9975 if empty: 9976 return objs 9977 9978 # Process the inner elements: 9979 while reader.forward(): 9980 objs.append(MacPoolReader.read_one(reader)) 9981 9982 # Discard the end tag: 9983 reader.read() 9984 9985 return objs
10000class MemoryOverCommitReader(Reader): 10001 10002 def __init__(self): 10003 super(MemoryOverCommitReader, self).__init__() 10004 10005 @staticmethod 10006 def read_one(reader): 10007 # Do nothing if there aren't more tags: 10008 if not reader.forward(): 10009 return None 10010 10011 # Create the object: 10012 obj = types.MemoryOverCommit() 10013 10014 # Process the attributes: 10015 obj.href = reader.get_attribute('href') 10016 10017 # Discard the start tag: 10018 empty = reader.empty_element() 10019 reader.read() 10020 if empty: 10021 return obj 10022 10023 # Process the inner elements: 10024 links = [] 10025 while reader.forward(): 10026 tag = reader.node_name() 10027 if tag == 'percent': 10028 obj.percent = Reader.read_integer(reader) 10029 else: 10030 reader.next_element() 10031 for link in links: 10032 MemoryOverCommitReader._process_link(link, obj) 10033 10034 # Discard the end tag: 10035 reader.read() 10036 10037 return obj 10038 10039 @staticmethod 10040 def read_many(reader): 10041 # Do nothing if there aren't more tags: 10042 objs = List() 10043 if not reader.forward(): 10044 return objs 10045 10046 # Process the attributes: 10047 objs.href = reader.get_attribute('href') 10048 10049 # Discard the start tag: 10050 empty = reader.empty_element() 10051 reader.read() 10052 if empty: 10053 return objs 10054 10055 # Process the inner elements: 10056 while reader.forward(): 10057 objs.append(MemoryOverCommitReader.read_one(reader)) 10058 10059 # Discard the end tag: 10060 reader.read() 10061 10062 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10005 @staticmethod 10006 def read_one(reader): 10007 # Do nothing if there aren't more tags: 10008 if not reader.forward(): 10009 return None 10010 10011 # Create the object: 10012 obj = types.MemoryOverCommit() 10013 10014 # Process the attributes: 10015 obj.href = reader.get_attribute('href') 10016 10017 # Discard the start tag: 10018 empty = reader.empty_element() 10019 reader.read() 10020 if empty: 10021 return obj 10022 10023 # Process the inner elements: 10024 links = [] 10025 while reader.forward(): 10026 tag = reader.node_name() 10027 if tag == 'percent': 10028 obj.percent = Reader.read_integer(reader) 10029 else: 10030 reader.next_element() 10031 for link in links: 10032 MemoryOverCommitReader._process_link(link, obj) 10033 10034 # Discard the end tag: 10035 reader.read() 10036 10037 return obj
10039 @staticmethod 10040 def read_many(reader): 10041 # Do nothing if there aren't more tags: 10042 objs = List() 10043 if not reader.forward(): 10044 return objs 10045 10046 # Process the attributes: 10047 objs.href = reader.get_attribute('href') 10048 10049 # Discard the start tag: 10050 empty = reader.empty_element() 10051 reader.read() 10052 if empty: 10053 return objs 10054 10055 # Process the inner elements: 10056 while reader.forward(): 10057 objs.append(MemoryOverCommitReader.read_one(reader)) 10058 10059 # Discard the end tag: 10060 reader.read() 10061 10062 return objs
10065class MemoryPolicyReader(Reader): 10066 10067 def __init__(self): 10068 super(MemoryPolicyReader, self).__init__() 10069 10070 @staticmethod 10071 def read_one(reader): 10072 # Do nothing if there aren't more tags: 10073 if not reader.forward(): 10074 return None 10075 10076 # Create the object: 10077 obj = types.MemoryPolicy() 10078 10079 # Process the attributes: 10080 obj.href = reader.get_attribute('href') 10081 10082 # Discard the start tag: 10083 empty = reader.empty_element() 10084 reader.read() 10085 if empty: 10086 return obj 10087 10088 # Process the inner elements: 10089 links = [] 10090 while reader.forward(): 10091 tag = reader.node_name() 10092 if tag == 'ballooning': 10093 obj.ballooning = Reader.read_boolean(reader) 10094 elif tag == 'guaranteed': 10095 obj.guaranteed = Reader.read_integer(reader) 10096 elif tag == 'max': 10097 obj.max = Reader.read_integer(reader) 10098 elif tag == 'over_commit': 10099 obj.over_commit = MemoryOverCommitReader.read_one(reader) 10100 elif tag == 'transparent_hugepages': 10101 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 10102 else: 10103 reader.next_element() 10104 for link in links: 10105 MemoryPolicyReader._process_link(link, obj) 10106 10107 # Discard the end tag: 10108 reader.read() 10109 10110 return obj 10111 10112 @staticmethod 10113 def read_many(reader): 10114 # Do nothing if there aren't more tags: 10115 objs = List() 10116 if not reader.forward(): 10117 return objs 10118 10119 # Process the attributes: 10120 objs.href = reader.get_attribute('href') 10121 10122 # Discard the start tag: 10123 empty = reader.empty_element() 10124 reader.read() 10125 if empty: 10126 return objs 10127 10128 # Process the inner elements: 10129 while reader.forward(): 10130 objs.append(MemoryPolicyReader.read_one(reader)) 10131 10132 # Discard the end tag: 10133 reader.read() 10134 10135 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10070 @staticmethod 10071 def read_one(reader): 10072 # Do nothing if there aren't more tags: 10073 if not reader.forward(): 10074 return None 10075 10076 # Create the object: 10077 obj = types.MemoryPolicy() 10078 10079 # Process the attributes: 10080 obj.href = reader.get_attribute('href') 10081 10082 # Discard the start tag: 10083 empty = reader.empty_element() 10084 reader.read() 10085 if empty: 10086 return obj 10087 10088 # Process the inner elements: 10089 links = [] 10090 while reader.forward(): 10091 tag = reader.node_name() 10092 if tag == 'ballooning': 10093 obj.ballooning = Reader.read_boolean(reader) 10094 elif tag == 'guaranteed': 10095 obj.guaranteed = Reader.read_integer(reader) 10096 elif tag == 'max': 10097 obj.max = Reader.read_integer(reader) 10098 elif tag == 'over_commit': 10099 obj.over_commit = MemoryOverCommitReader.read_one(reader) 10100 elif tag == 'transparent_hugepages': 10101 obj.transparent_huge_pages = TransparentHugePagesReader.read_one(reader) 10102 else: 10103 reader.next_element() 10104 for link in links: 10105 MemoryPolicyReader._process_link(link, obj) 10106 10107 # Discard the end tag: 10108 reader.read() 10109 10110 return obj
10112 @staticmethod 10113 def read_many(reader): 10114 # Do nothing if there aren't more tags: 10115 objs = List() 10116 if not reader.forward(): 10117 return objs 10118 10119 # Process the attributes: 10120 objs.href = reader.get_attribute('href') 10121 10122 # Discard the start tag: 10123 empty = reader.empty_element() 10124 reader.read() 10125 if empty: 10126 return objs 10127 10128 # Process the inner elements: 10129 while reader.forward(): 10130 objs.append(MemoryPolicyReader.read_one(reader)) 10131 10132 # Discard the end tag: 10133 reader.read() 10134 10135 return objs
10138class MethodReader(Reader): 10139 10140 def __init__(self): 10141 super(MethodReader, self).__init__() 10142 10143 @staticmethod 10144 def read_one(reader): 10145 # Do nothing if there aren't more tags: 10146 if not reader.forward(): 10147 return None 10148 10149 # Create the object: 10150 obj = types.Method() 10151 10152 # Process the attributes: 10153 obj.href = reader.get_attribute('href') 10154 value = reader.get_attribute('id') 10155 if value is not None: 10156 obj.id = types.SsoMethod(value.lower()) 10157 10158 # Discard the start tag: 10159 empty = reader.empty_element() 10160 reader.read() 10161 if empty: 10162 return obj 10163 10164 # Process the inner elements: 10165 reader.next_element() 10166 10167 # Discard the end tag: 10168 reader.read() 10169 10170 return obj 10171 10172 @staticmethod 10173 def read_many(reader): 10174 # Do nothing if there aren't more tags: 10175 objs = List() 10176 if not reader.forward(): 10177 return objs 10178 10179 # Process the attributes: 10180 objs.href = reader.get_attribute('href') 10181 10182 # Discard the start tag: 10183 empty = reader.empty_element() 10184 reader.read() 10185 if empty: 10186 return objs 10187 10188 # Process the inner elements: 10189 while reader.forward(): 10190 objs.append(MethodReader.read_one(reader)) 10191 10192 # Discard the end tag: 10193 reader.read() 10194 10195 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10143 @staticmethod 10144 def read_one(reader): 10145 # Do nothing if there aren't more tags: 10146 if not reader.forward(): 10147 return None 10148 10149 # Create the object: 10150 obj = types.Method() 10151 10152 # Process the attributes: 10153 obj.href = reader.get_attribute('href') 10154 value = reader.get_attribute('id') 10155 if value is not None: 10156 obj.id = types.SsoMethod(value.lower()) 10157 10158 # Discard the start tag: 10159 empty = reader.empty_element() 10160 reader.read() 10161 if empty: 10162 return obj 10163 10164 # Process the inner elements: 10165 reader.next_element() 10166 10167 # Discard the end tag: 10168 reader.read() 10169 10170 return obj
10172 @staticmethod 10173 def read_many(reader): 10174 # Do nothing if there aren't more tags: 10175 objs = List() 10176 if not reader.forward(): 10177 return objs 10178 10179 # Process the attributes: 10180 objs.href = reader.get_attribute('href') 10181 10182 # Discard the start tag: 10183 empty = reader.empty_element() 10184 reader.read() 10185 if empty: 10186 return objs 10187 10188 # Process the inner elements: 10189 while reader.forward(): 10190 objs.append(MethodReader.read_one(reader)) 10191 10192 # Discard the end tag: 10193 reader.read() 10194 10195 return objs
10198class MigrationBandwidthReader(Reader): 10199 10200 def __init__(self): 10201 super(MigrationBandwidthReader, self).__init__() 10202 10203 @staticmethod 10204 def read_one(reader): 10205 # Do nothing if there aren't more tags: 10206 if not reader.forward(): 10207 return None 10208 10209 # Create the object: 10210 obj = types.MigrationBandwidth() 10211 10212 # Process the attributes: 10213 obj.href = reader.get_attribute('href') 10214 10215 # Discard the start tag: 10216 empty = reader.empty_element() 10217 reader.read() 10218 if empty: 10219 return obj 10220 10221 # Process the inner elements: 10222 links = [] 10223 while reader.forward(): 10224 tag = reader.node_name() 10225 if tag == 'assignment_method': 10226 obj.assignment_method = Reader.read_enum(types.MigrationBandwidthAssignmentMethod, reader) 10227 elif tag == 'custom_value': 10228 obj.custom_value = Reader.read_integer(reader) 10229 else: 10230 reader.next_element() 10231 for link in links: 10232 MigrationBandwidthReader._process_link(link, obj) 10233 10234 # Discard the end tag: 10235 reader.read() 10236 10237 return obj 10238 10239 @staticmethod 10240 def read_many(reader): 10241 # Do nothing if there aren't more tags: 10242 objs = List() 10243 if not reader.forward(): 10244 return objs 10245 10246 # Process the attributes: 10247 objs.href = reader.get_attribute('href') 10248 10249 # Discard the start tag: 10250 empty = reader.empty_element() 10251 reader.read() 10252 if empty: 10253 return objs 10254 10255 # Process the inner elements: 10256 while reader.forward(): 10257 objs.append(MigrationBandwidthReader.read_one(reader)) 10258 10259 # Discard the end tag: 10260 reader.read() 10261 10262 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10203 @staticmethod 10204 def read_one(reader): 10205 # Do nothing if there aren't more tags: 10206 if not reader.forward(): 10207 return None 10208 10209 # Create the object: 10210 obj = types.MigrationBandwidth() 10211 10212 # Process the attributes: 10213 obj.href = reader.get_attribute('href') 10214 10215 # Discard the start tag: 10216 empty = reader.empty_element() 10217 reader.read() 10218 if empty: 10219 return obj 10220 10221 # Process the inner elements: 10222 links = [] 10223 while reader.forward(): 10224 tag = reader.node_name() 10225 if tag == 'assignment_method': 10226 obj.assignment_method = Reader.read_enum(types.MigrationBandwidthAssignmentMethod, reader) 10227 elif tag == 'custom_value': 10228 obj.custom_value = Reader.read_integer(reader) 10229 else: 10230 reader.next_element() 10231 for link in links: 10232 MigrationBandwidthReader._process_link(link, obj) 10233 10234 # Discard the end tag: 10235 reader.read() 10236 10237 return obj
10239 @staticmethod 10240 def read_many(reader): 10241 # Do nothing if there aren't more tags: 10242 objs = List() 10243 if not reader.forward(): 10244 return objs 10245 10246 # Process the attributes: 10247 objs.href = reader.get_attribute('href') 10248 10249 # Discard the start tag: 10250 empty = reader.empty_element() 10251 reader.read() 10252 if empty: 10253 return objs 10254 10255 # Process the inner elements: 10256 while reader.forward(): 10257 objs.append(MigrationBandwidthReader.read_one(reader)) 10258 10259 # Discard the end tag: 10260 reader.read() 10261 10262 return objs
10265class MigrationOptionsReader(Reader): 10266 10267 def __init__(self): 10268 super(MigrationOptionsReader, self).__init__() 10269 10270 @staticmethod 10271 def read_one(reader): 10272 # Do nothing if there aren't more tags: 10273 if not reader.forward(): 10274 return None 10275 10276 # Create the object: 10277 obj = types.MigrationOptions() 10278 10279 # Process the attributes: 10280 obj.href = reader.get_attribute('href') 10281 10282 # Discard the start tag: 10283 empty = reader.empty_element() 10284 reader.read() 10285 if empty: 10286 return obj 10287 10288 # Process the inner elements: 10289 links = [] 10290 while reader.forward(): 10291 tag = reader.node_name() 10292 if tag == 'auto_converge': 10293 obj.auto_converge = Reader.read_enum(types.InheritableBoolean, reader) 10294 elif tag == 'bandwidth': 10295 obj.bandwidth = MigrationBandwidthReader.read_one(reader) 10296 elif tag == 'compressed': 10297 obj.compressed = Reader.read_enum(types.InheritableBoolean, reader) 10298 elif tag == 'encrypted': 10299 obj.encrypted = Reader.read_enum(types.InheritableBoolean, reader) 10300 elif tag == 'policy': 10301 obj.policy = MigrationPolicyReader.read_one(reader) 10302 else: 10303 reader.next_element() 10304 for link in links: 10305 MigrationOptionsReader._process_link(link, obj) 10306 10307 # Discard the end tag: 10308 reader.read() 10309 10310 return obj 10311 10312 @staticmethod 10313 def read_many(reader): 10314 # Do nothing if there aren't more tags: 10315 objs = List() 10316 if not reader.forward(): 10317 return objs 10318 10319 # Process the attributes: 10320 objs.href = reader.get_attribute('href') 10321 10322 # Discard the start tag: 10323 empty = reader.empty_element() 10324 reader.read() 10325 if empty: 10326 return objs 10327 10328 # Process the inner elements: 10329 while reader.forward(): 10330 objs.append(MigrationOptionsReader.read_one(reader)) 10331 10332 # Discard the end tag: 10333 reader.read() 10334 10335 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10270 @staticmethod 10271 def read_one(reader): 10272 # Do nothing if there aren't more tags: 10273 if not reader.forward(): 10274 return None 10275 10276 # Create the object: 10277 obj = types.MigrationOptions() 10278 10279 # Process the attributes: 10280 obj.href = reader.get_attribute('href') 10281 10282 # Discard the start tag: 10283 empty = reader.empty_element() 10284 reader.read() 10285 if empty: 10286 return obj 10287 10288 # Process the inner elements: 10289 links = [] 10290 while reader.forward(): 10291 tag = reader.node_name() 10292 if tag == 'auto_converge': 10293 obj.auto_converge = Reader.read_enum(types.InheritableBoolean, reader) 10294 elif tag == 'bandwidth': 10295 obj.bandwidth = MigrationBandwidthReader.read_one(reader) 10296 elif tag == 'compressed': 10297 obj.compressed = Reader.read_enum(types.InheritableBoolean, reader) 10298 elif tag == 'encrypted': 10299 obj.encrypted = Reader.read_enum(types.InheritableBoolean, reader) 10300 elif tag == 'policy': 10301 obj.policy = MigrationPolicyReader.read_one(reader) 10302 else: 10303 reader.next_element() 10304 for link in links: 10305 MigrationOptionsReader._process_link(link, obj) 10306 10307 # Discard the end tag: 10308 reader.read() 10309 10310 return obj
10312 @staticmethod 10313 def read_many(reader): 10314 # Do nothing if there aren't more tags: 10315 objs = List() 10316 if not reader.forward(): 10317 return objs 10318 10319 # Process the attributes: 10320 objs.href = reader.get_attribute('href') 10321 10322 # Discard the start tag: 10323 empty = reader.empty_element() 10324 reader.read() 10325 if empty: 10326 return objs 10327 10328 # Process the inner elements: 10329 while reader.forward(): 10330 objs.append(MigrationOptionsReader.read_one(reader)) 10331 10332 # Discard the end tag: 10333 reader.read() 10334 10335 return objs
10338class MigrationPolicyReader(Reader): 10339 10340 def __init__(self): 10341 super(MigrationPolicyReader, self).__init__() 10342 10343 @staticmethod 10344 def read_one(reader): 10345 # Do nothing if there aren't more tags: 10346 if not reader.forward(): 10347 return None 10348 10349 # Create the object: 10350 obj = types.MigrationPolicy() 10351 10352 # Process the attributes: 10353 obj.href = reader.get_attribute('href') 10354 value = reader.get_attribute('id') 10355 if value is not None: 10356 obj.id = value 10357 10358 # Discard the start tag: 10359 empty = reader.empty_element() 10360 reader.read() 10361 if empty: 10362 return obj 10363 10364 # Process the inner elements: 10365 links = [] 10366 while reader.forward(): 10367 tag = reader.node_name() 10368 if tag == 'comment': 10369 obj.comment = Reader.read_string(reader) 10370 elif tag == 'description': 10371 obj.description = Reader.read_string(reader) 10372 elif tag == 'name': 10373 obj.name = Reader.read_string(reader) 10374 else: 10375 reader.next_element() 10376 for link in links: 10377 MigrationPolicyReader._process_link(link, obj) 10378 10379 # Discard the end tag: 10380 reader.read() 10381 10382 return obj 10383 10384 @staticmethod 10385 def read_many(reader): 10386 # Do nothing if there aren't more tags: 10387 objs = List() 10388 if not reader.forward(): 10389 return objs 10390 10391 # Process the attributes: 10392 objs.href = reader.get_attribute('href') 10393 10394 # Discard the start tag: 10395 empty = reader.empty_element() 10396 reader.read() 10397 if empty: 10398 return objs 10399 10400 # Process the inner elements: 10401 while reader.forward(): 10402 objs.append(MigrationPolicyReader.read_one(reader)) 10403 10404 # Discard the end tag: 10405 reader.read() 10406 10407 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10343 @staticmethod 10344 def read_one(reader): 10345 # Do nothing if there aren't more tags: 10346 if not reader.forward(): 10347 return None 10348 10349 # Create the object: 10350 obj = types.MigrationPolicy() 10351 10352 # Process the attributes: 10353 obj.href = reader.get_attribute('href') 10354 value = reader.get_attribute('id') 10355 if value is not None: 10356 obj.id = value 10357 10358 # Discard the start tag: 10359 empty = reader.empty_element() 10360 reader.read() 10361 if empty: 10362 return obj 10363 10364 # Process the inner elements: 10365 links = [] 10366 while reader.forward(): 10367 tag = reader.node_name() 10368 if tag == 'comment': 10369 obj.comment = Reader.read_string(reader) 10370 elif tag == 'description': 10371 obj.description = Reader.read_string(reader) 10372 elif tag == 'name': 10373 obj.name = Reader.read_string(reader) 10374 else: 10375 reader.next_element() 10376 for link in links: 10377 MigrationPolicyReader._process_link(link, obj) 10378 10379 # Discard the end tag: 10380 reader.read() 10381 10382 return obj
10384 @staticmethod 10385 def read_many(reader): 10386 # Do nothing if there aren't more tags: 10387 objs = List() 10388 if not reader.forward(): 10389 return objs 10390 10391 # Process the attributes: 10392 objs.href = reader.get_attribute('href') 10393 10394 # Discard the start tag: 10395 empty = reader.empty_element() 10396 reader.read() 10397 if empty: 10398 return objs 10399 10400 # Process the inner elements: 10401 while reader.forward(): 10402 objs.append(MigrationPolicyReader.read_one(reader)) 10403 10404 # Discard the end tag: 10405 reader.read() 10406 10407 return objs
10410class NetworkReader(Reader): 10411 10412 def __init__(self): 10413 super(NetworkReader, self).__init__() 10414 10415 @staticmethod 10416 def read_one(reader): 10417 # Do nothing if there aren't more tags: 10418 if not reader.forward(): 10419 return None 10420 10421 # Create the object: 10422 obj = types.Network() 10423 10424 # Process the attributes: 10425 obj.href = reader.get_attribute('href') 10426 value = reader.get_attribute('id') 10427 if value is not None: 10428 obj.id = value 10429 10430 # Discard the start tag: 10431 empty = reader.empty_element() 10432 reader.read() 10433 if empty: 10434 return obj 10435 10436 # Process the inner elements: 10437 links = [] 10438 while reader.forward(): 10439 tag = reader.node_name() 10440 if tag == 'cluster': 10441 obj.cluster = ClusterReader.read_one(reader) 10442 elif tag == 'comment': 10443 obj.comment = Reader.read_string(reader) 10444 elif tag == 'data_center': 10445 obj.data_center = DataCenterReader.read_one(reader) 10446 elif tag == 'description': 10447 obj.description = Reader.read_string(reader) 10448 elif tag == 'display': 10449 obj.display = Reader.read_boolean(reader) 10450 elif tag == 'dns_resolver_configuration': 10451 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10452 elif tag == 'external_provider': 10453 obj.external_provider = OpenStackNetworkProviderReader.read_one(reader) 10454 elif tag == 'external_provider_physical_network': 10455 obj.external_provider_physical_network = NetworkReader.read_one(reader) 10456 elif tag == 'ip': 10457 obj.ip = IpReader.read_one(reader) 10458 elif tag == 'mtu': 10459 obj.mtu = Reader.read_integer(reader) 10460 elif tag == 'name': 10461 obj.name = Reader.read_string(reader) 10462 elif tag == 'network_labels': 10463 obj.network_labels = NetworkLabelReader.read_many(reader) 10464 elif tag == 'permissions': 10465 obj.permissions = PermissionReader.read_many(reader) 10466 elif tag == 'port_isolation': 10467 obj.port_isolation = Reader.read_boolean(reader) 10468 elif tag == 'profile_required': 10469 obj.profile_required = Reader.read_boolean(reader) 10470 elif tag == 'qos': 10471 obj.qos = QosReader.read_one(reader) 10472 elif tag == 'required': 10473 obj.required = Reader.read_boolean(reader) 10474 elif tag == 'status': 10475 obj.status = Reader.read_enum(types.NetworkStatus, reader) 10476 elif tag == 'stp': 10477 obj.stp = Reader.read_boolean(reader) 10478 elif tag == 'usages': 10479 obj.usages = Reader.read_enums(types.NetworkUsage, reader) 10480 elif tag == 'vdsm_name': 10481 obj.vdsm_name = Reader.read_string(reader) 10482 elif tag == 'vlan': 10483 obj.vlan = VlanReader.read_one(reader) 10484 elif tag == 'vnic_profiles': 10485 obj.vnic_profiles = VnicProfileReader.read_many(reader) 10486 elif tag == 'link': 10487 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 10488 reader.next_element() 10489 else: 10490 reader.next_element() 10491 for link in links: 10492 NetworkReader._process_link(link, obj) 10493 10494 # Discard the end tag: 10495 reader.read() 10496 10497 return obj 10498 10499 @staticmethod 10500 def read_many(reader): 10501 # Do nothing if there aren't more tags: 10502 objs = List() 10503 if not reader.forward(): 10504 return objs 10505 10506 # Process the attributes: 10507 objs.href = reader.get_attribute('href') 10508 10509 # Discard the start tag: 10510 empty = reader.empty_element() 10511 reader.read() 10512 if empty: 10513 return objs 10514 10515 # Process the inner elements: 10516 while reader.forward(): 10517 objs.append(NetworkReader.read_one(reader)) 10518 10519 # Discard the end tag: 10520 reader.read() 10521 10522 return objs 10523 10524 @staticmethod 10525 def _process_link(link, obj): 10526 # Process the attributes: 10527 rel = link[0] 10528 href = link[1] 10529 if href and rel: 10530 if rel == "networklabels": 10531 if obj.network_labels is not None: 10532 obj.network_labels.href = href 10533 else: 10534 obj.network_labels = List(href) 10535 elif rel == "permissions": 10536 if obj.permissions is not None: 10537 obj.permissions.href = href 10538 else: 10539 obj.permissions = List(href) 10540 elif rel == "vnicprofiles": 10541 if obj.vnic_profiles is not None: 10542 obj.vnic_profiles.href = href 10543 else: 10544 obj.vnic_profiles = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10415 @staticmethod 10416 def read_one(reader): 10417 # Do nothing if there aren't more tags: 10418 if not reader.forward(): 10419 return None 10420 10421 # Create the object: 10422 obj = types.Network() 10423 10424 # Process the attributes: 10425 obj.href = reader.get_attribute('href') 10426 value = reader.get_attribute('id') 10427 if value is not None: 10428 obj.id = value 10429 10430 # Discard the start tag: 10431 empty = reader.empty_element() 10432 reader.read() 10433 if empty: 10434 return obj 10435 10436 # Process the inner elements: 10437 links = [] 10438 while reader.forward(): 10439 tag = reader.node_name() 10440 if tag == 'cluster': 10441 obj.cluster = ClusterReader.read_one(reader) 10442 elif tag == 'comment': 10443 obj.comment = Reader.read_string(reader) 10444 elif tag == 'data_center': 10445 obj.data_center = DataCenterReader.read_one(reader) 10446 elif tag == 'description': 10447 obj.description = Reader.read_string(reader) 10448 elif tag == 'display': 10449 obj.display = Reader.read_boolean(reader) 10450 elif tag == 'dns_resolver_configuration': 10451 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10452 elif tag == 'external_provider': 10453 obj.external_provider = OpenStackNetworkProviderReader.read_one(reader) 10454 elif tag == 'external_provider_physical_network': 10455 obj.external_provider_physical_network = NetworkReader.read_one(reader) 10456 elif tag == 'ip': 10457 obj.ip = IpReader.read_one(reader) 10458 elif tag == 'mtu': 10459 obj.mtu = Reader.read_integer(reader) 10460 elif tag == 'name': 10461 obj.name = Reader.read_string(reader) 10462 elif tag == 'network_labels': 10463 obj.network_labels = NetworkLabelReader.read_many(reader) 10464 elif tag == 'permissions': 10465 obj.permissions = PermissionReader.read_many(reader) 10466 elif tag == 'port_isolation': 10467 obj.port_isolation = Reader.read_boolean(reader) 10468 elif tag == 'profile_required': 10469 obj.profile_required = Reader.read_boolean(reader) 10470 elif tag == 'qos': 10471 obj.qos = QosReader.read_one(reader) 10472 elif tag == 'required': 10473 obj.required = Reader.read_boolean(reader) 10474 elif tag == 'status': 10475 obj.status = Reader.read_enum(types.NetworkStatus, reader) 10476 elif tag == 'stp': 10477 obj.stp = Reader.read_boolean(reader) 10478 elif tag == 'usages': 10479 obj.usages = Reader.read_enums(types.NetworkUsage, reader) 10480 elif tag == 'vdsm_name': 10481 obj.vdsm_name = Reader.read_string(reader) 10482 elif tag == 'vlan': 10483 obj.vlan = VlanReader.read_one(reader) 10484 elif tag == 'vnic_profiles': 10485 obj.vnic_profiles = VnicProfileReader.read_many(reader) 10486 elif tag == 'link': 10487 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 10488 reader.next_element() 10489 else: 10490 reader.next_element() 10491 for link in links: 10492 NetworkReader._process_link(link, obj) 10493 10494 # Discard the end tag: 10495 reader.read() 10496 10497 return obj
10499 @staticmethod 10500 def read_many(reader): 10501 # Do nothing if there aren't more tags: 10502 objs = List() 10503 if not reader.forward(): 10504 return objs 10505 10506 # Process the attributes: 10507 objs.href = reader.get_attribute('href') 10508 10509 # Discard the start tag: 10510 empty = reader.empty_element() 10511 reader.read() 10512 if empty: 10513 return objs 10514 10515 # Process the inner elements: 10516 while reader.forward(): 10517 objs.append(NetworkReader.read_one(reader)) 10518 10519 # Discard the end tag: 10520 reader.read() 10521 10522 return objs
10547class NetworkAttachmentReader(Reader): 10548 10549 def __init__(self): 10550 super(NetworkAttachmentReader, self).__init__() 10551 10552 @staticmethod 10553 def read_one(reader): 10554 # Do nothing if there aren't more tags: 10555 if not reader.forward(): 10556 return None 10557 10558 # Create the object: 10559 obj = types.NetworkAttachment() 10560 10561 # Process the attributes: 10562 obj.href = reader.get_attribute('href') 10563 value = reader.get_attribute('id') 10564 if value is not None: 10565 obj.id = value 10566 10567 # Discard the start tag: 10568 empty = reader.empty_element() 10569 reader.read() 10570 if empty: 10571 return obj 10572 10573 # Process the inner elements: 10574 links = [] 10575 while reader.forward(): 10576 tag = reader.node_name() 10577 if tag == 'comment': 10578 obj.comment = Reader.read_string(reader) 10579 elif tag == 'description': 10580 obj.description = Reader.read_string(reader) 10581 elif tag == 'dns_resolver_configuration': 10582 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10583 elif tag == 'host': 10584 obj.host = HostReader.read_one(reader) 10585 elif tag == 'host_nic': 10586 obj.host_nic = HostNicReader.read_one(reader) 10587 elif tag == 'in_sync': 10588 obj.in_sync = Reader.read_boolean(reader) 10589 elif tag == 'ip_address_assignments': 10590 obj.ip_address_assignments = IpAddressAssignmentReader.read_many(reader) 10591 elif tag == 'name': 10592 obj.name = Reader.read_string(reader) 10593 elif tag == 'network': 10594 obj.network = NetworkReader.read_one(reader) 10595 elif tag == 'properties': 10596 obj.properties = PropertyReader.read_many(reader) 10597 elif tag == 'qos': 10598 obj.qos = QosReader.read_one(reader) 10599 elif tag == 'reported_configurations': 10600 obj.reported_configurations = ReportedConfigurationReader.read_many(reader) 10601 else: 10602 reader.next_element() 10603 for link in links: 10604 NetworkAttachmentReader._process_link(link, obj) 10605 10606 # Discard the end tag: 10607 reader.read() 10608 10609 return obj 10610 10611 @staticmethod 10612 def read_many(reader): 10613 # Do nothing if there aren't more tags: 10614 objs = List() 10615 if not reader.forward(): 10616 return objs 10617 10618 # Process the attributes: 10619 objs.href = reader.get_attribute('href') 10620 10621 # Discard the start tag: 10622 empty = reader.empty_element() 10623 reader.read() 10624 if empty: 10625 return objs 10626 10627 # Process the inner elements: 10628 while reader.forward(): 10629 objs.append(NetworkAttachmentReader.read_one(reader)) 10630 10631 # Discard the end tag: 10632 reader.read() 10633 10634 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10552 @staticmethod 10553 def read_one(reader): 10554 # Do nothing if there aren't more tags: 10555 if not reader.forward(): 10556 return None 10557 10558 # Create the object: 10559 obj = types.NetworkAttachment() 10560 10561 # Process the attributes: 10562 obj.href = reader.get_attribute('href') 10563 value = reader.get_attribute('id') 10564 if value is not None: 10565 obj.id = value 10566 10567 # Discard the start tag: 10568 empty = reader.empty_element() 10569 reader.read() 10570 if empty: 10571 return obj 10572 10573 # Process the inner elements: 10574 links = [] 10575 while reader.forward(): 10576 tag = reader.node_name() 10577 if tag == 'comment': 10578 obj.comment = Reader.read_string(reader) 10579 elif tag == 'description': 10580 obj.description = Reader.read_string(reader) 10581 elif tag == 'dns_resolver_configuration': 10582 obj.dns_resolver_configuration = DnsResolverConfigurationReader.read_one(reader) 10583 elif tag == 'host': 10584 obj.host = HostReader.read_one(reader) 10585 elif tag == 'host_nic': 10586 obj.host_nic = HostNicReader.read_one(reader) 10587 elif tag == 'in_sync': 10588 obj.in_sync = Reader.read_boolean(reader) 10589 elif tag == 'ip_address_assignments': 10590 obj.ip_address_assignments = IpAddressAssignmentReader.read_many(reader) 10591 elif tag == 'name': 10592 obj.name = Reader.read_string(reader) 10593 elif tag == 'network': 10594 obj.network = NetworkReader.read_one(reader) 10595 elif tag == 'properties': 10596 obj.properties = PropertyReader.read_many(reader) 10597 elif tag == 'qos': 10598 obj.qos = QosReader.read_one(reader) 10599 elif tag == 'reported_configurations': 10600 obj.reported_configurations = ReportedConfigurationReader.read_many(reader) 10601 else: 10602 reader.next_element() 10603 for link in links: 10604 NetworkAttachmentReader._process_link(link, obj) 10605 10606 # Discard the end tag: 10607 reader.read() 10608 10609 return obj
10611 @staticmethod 10612 def read_many(reader): 10613 # Do nothing if there aren't more tags: 10614 objs = List() 10615 if not reader.forward(): 10616 return objs 10617 10618 # Process the attributes: 10619 objs.href = reader.get_attribute('href') 10620 10621 # Discard the start tag: 10622 empty = reader.empty_element() 10623 reader.read() 10624 if empty: 10625 return objs 10626 10627 # Process the inner elements: 10628 while reader.forward(): 10629 objs.append(NetworkAttachmentReader.read_one(reader)) 10630 10631 # Discard the end tag: 10632 reader.read() 10633 10634 return objs
10637class NetworkConfigurationReader(Reader): 10638 10639 def __init__(self): 10640 super(NetworkConfigurationReader, self).__init__() 10641 10642 @staticmethod 10643 def read_one(reader): 10644 # Do nothing if there aren't more tags: 10645 if not reader.forward(): 10646 return None 10647 10648 # Create the object: 10649 obj = types.NetworkConfiguration() 10650 10651 # Process the attributes: 10652 obj.href = reader.get_attribute('href') 10653 10654 # Discard the start tag: 10655 empty = reader.empty_element() 10656 reader.read() 10657 if empty: 10658 return obj 10659 10660 # Process the inner elements: 10661 links = [] 10662 while reader.forward(): 10663 tag = reader.node_name() 10664 if tag == 'dns': 10665 obj.dns = DnsReader.read_one(reader) 10666 elif tag == 'nics': 10667 obj.nics = NicReader.read_many(reader) 10668 else: 10669 reader.next_element() 10670 for link in links: 10671 NetworkConfigurationReader._process_link(link, obj) 10672 10673 # Discard the end tag: 10674 reader.read() 10675 10676 return obj 10677 10678 @staticmethod 10679 def read_many(reader): 10680 # Do nothing if there aren't more tags: 10681 objs = List() 10682 if not reader.forward(): 10683 return objs 10684 10685 # Process the attributes: 10686 objs.href = reader.get_attribute('href') 10687 10688 # Discard the start tag: 10689 empty = reader.empty_element() 10690 reader.read() 10691 if empty: 10692 return objs 10693 10694 # Process the inner elements: 10695 while reader.forward(): 10696 objs.append(NetworkConfigurationReader.read_one(reader)) 10697 10698 # Discard the end tag: 10699 reader.read() 10700 10701 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10642 @staticmethod 10643 def read_one(reader): 10644 # Do nothing if there aren't more tags: 10645 if not reader.forward(): 10646 return None 10647 10648 # Create the object: 10649 obj = types.NetworkConfiguration() 10650 10651 # Process the attributes: 10652 obj.href = reader.get_attribute('href') 10653 10654 # Discard the start tag: 10655 empty = reader.empty_element() 10656 reader.read() 10657 if empty: 10658 return obj 10659 10660 # Process the inner elements: 10661 links = [] 10662 while reader.forward(): 10663 tag = reader.node_name() 10664 if tag == 'dns': 10665 obj.dns = DnsReader.read_one(reader) 10666 elif tag == 'nics': 10667 obj.nics = NicReader.read_many(reader) 10668 else: 10669 reader.next_element() 10670 for link in links: 10671 NetworkConfigurationReader._process_link(link, obj) 10672 10673 # Discard the end tag: 10674 reader.read() 10675 10676 return obj
10678 @staticmethod 10679 def read_many(reader): 10680 # Do nothing if there aren't more tags: 10681 objs = List() 10682 if not reader.forward(): 10683 return objs 10684 10685 # Process the attributes: 10686 objs.href = reader.get_attribute('href') 10687 10688 # Discard the start tag: 10689 empty = reader.empty_element() 10690 reader.read() 10691 if empty: 10692 return objs 10693 10694 # Process the inner elements: 10695 while reader.forward(): 10696 objs.append(NetworkConfigurationReader.read_one(reader)) 10697 10698 # Discard the end tag: 10699 reader.read() 10700 10701 return objs
10704class NetworkFilterReader(Reader): 10705 10706 def __init__(self): 10707 super(NetworkFilterReader, self).__init__() 10708 10709 @staticmethod 10710 def read_one(reader): 10711 # Do nothing if there aren't more tags: 10712 if not reader.forward(): 10713 return None 10714 10715 # Create the object: 10716 obj = types.NetworkFilter() 10717 10718 # Process the attributes: 10719 obj.href = reader.get_attribute('href') 10720 value = reader.get_attribute('id') 10721 if value is not None: 10722 obj.id = value 10723 10724 # Discard the start tag: 10725 empty = reader.empty_element() 10726 reader.read() 10727 if empty: 10728 return obj 10729 10730 # Process the inner elements: 10731 links = [] 10732 while reader.forward(): 10733 tag = reader.node_name() 10734 if tag == 'comment': 10735 obj.comment = Reader.read_string(reader) 10736 elif tag == 'description': 10737 obj.description = Reader.read_string(reader) 10738 elif tag == 'name': 10739 obj.name = Reader.read_string(reader) 10740 elif tag == 'version': 10741 obj.version = VersionReader.read_one(reader) 10742 else: 10743 reader.next_element() 10744 for link in links: 10745 NetworkFilterReader._process_link(link, obj) 10746 10747 # Discard the end tag: 10748 reader.read() 10749 10750 return obj 10751 10752 @staticmethod 10753 def read_many(reader): 10754 # Do nothing if there aren't more tags: 10755 objs = List() 10756 if not reader.forward(): 10757 return objs 10758 10759 # Process the attributes: 10760 objs.href = reader.get_attribute('href') 10761 10762 # Discard the start tag: 10763 empty = reader.empty_element() 10764 reader.read() 10765 if empty: 10766 return objs 10767 10768 # Process the inner elements: 10769 while reader.forward(): 10770 objs.append(NetworkFilterReader.read_one(reader)) 10771 10772 # Discard the end tag: 10773 reader.read() 10774 10775 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10709 @staticmethod 10710 def read_one(reader): 10711 # Do nothing if there aren't more tags: 10712 if not reader.forward(): 10713 return None 10714 10715 # Create the object: 10716 obj = types.NetworkFilter() 10717 10718 # Process the attributes: 10719 obj.href = reader.get_attribute('href') 10720 value = reader.get_attribute('id') 10721 if value is not None: 10722 obj.id = value 10723 10724 # Discard the start tag: 10725 empty = reader.empty_element() 10726 reader.read() 10727 if empty: 10728 return obj 10729 10730 # Process the inner elements: 10731 links = [] 10732 while reader.forward(): 10733 tag = reader.node_name() 10734 if tag == 'comment': 10735 obj.comment = Reader.read_string(reader) 10736 elif tag == 'description': 10737 obj.description = Reader.read_string(reader) 10738 elif tag == 'name': 10739 obj.name = Reader.read_string(reader) 10740 elif tag == 'version': 10741 obj.version = VersionReader.read_one(reader) 10742 else: 10743 reader.next_element() 10744 for link in links: 10745 NetworkFilterReader._process_link(link, obj) 10746 10747 # Discard the end tag: 10748 reader.read() 10749 10750 return obj
10752 @staticmethod 10753 def read_many(reader): 10754 # Do nothing if there aren't more tags: 10755 objs = List() 10756 if not reader.forward(): 10757 return objs 10758 10759 # Process the attributes: 10760 objs.href = reader.get_attribute('href') 10761 10762 # Discard the start tag: 10763 empty = reader.empty_element() 10764 reader.read() 10765 if empty: 10766 return objs 10767 10768 # Process the inner elements: 10769 while reader.forward(): 10770 objs.append(NetworkFilterReader.read_one(reader)) 10771 10772 # Discard the end tag: 10773 reader.read() 10774 10775 return objs
10778class NetworkFilterParameterReader(Reader): 10779 10780 def __init__(self): 10781 super(NetworkFilterParameterReader, self).__init__() 10782 10783 @staticmethod 10784 def read_one(reader): 10785 # Do nothing if there aren't more tags: 10786 if not reader.forward(): 10787 return None 10788 10789 # Create the object: 10790 obj = types.NetworkFilterParameter() 10791 10792 # Process the attributes: 10793 obj.href = reader.get_attribute('href') 10794 value = reader.get_attribute('id') 10795 if value is not None: 10796 obj.id = value 10797 10798 # Discard the start tag: 10799 empty = reader.empty_element() 10800 reader.read() 10801 if empty: 10802 return obj 10803 10804 # Process the inner elements: 10805 links = [] 10806 while reader.forward(): 10807 tag = reader.node_name() 10808 if tag == 'comment': 10809 obj.comment = Reader.read_string(reader) 10810 elif tag == 'description': 10811 obj.description = Reader.read_string(reader) 10812 elif tag == 'name': 10813 obj.name = Reader.read_string(reader) 10814 elif tag == 'nic': 10815 obj.nic = NicReader.read_one(reader) 10816 elif tag == 'value': 10817 obj.value = Reader.read_string(reader) 10818 else: 10819 reader.next_element() 10820 for link in links: 10821 NetworkFilterParameterReader._process_link(link, obj) 10822 10823 # Discard the end tag: 10824 reader.read() 10825 10826 return obj 10827 10828 @staticmethod 10829 def read_many(reader): 10830 # Do nothing if there aren't more tags: 10831 objs = List() 10832 if not reader.forward(): 10833 return objs 10834 10835 # Process the attributes: 10836 objs.href = reader.get_attribute('href') 10837 10838 # Discard the start tag: 10839 empty = reader.empty_element() 10840 reader.read() 10841 if empty: 10842 return objs 10843 10844 # Process the inner elements: 10845 while reader.forward(): 10846 objs.append(NetworkFilterParameterReader.read_one(reader)) 10847 10848 # Discard the end tag: 10849 reader.read() 10850 10851 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10783 @staticmethod 10784 def read_one(reader): 10785 # Do nothing if there aren't more tags: 10786 if not reader.forward(): 10787 return None 10788 10789 # Create the object: 10790 obj = types.NetworkFilterParameter() 10791 10792 # Process the attributes: 10793 obj.href = reader.get_attribute('href') 10794 value = reader.get_attribute('id') 10795 if value is not None: 10796 obj.id = value 10797 10798 # Discard the start tag: 10799 empty = reader.empty_element() 10800 reader.read() 10801 if empty: 10802 return obj 10803 10804 # Process the inner elements: 10805 links = [] 10806 while reader.forward(): 10807 tag = reader.node_name() 10808 if tag == 'comment': 10809 obj.comment = Reader.read_string(reader) 10810 elif tag == 'description': 10811 obj.description = Reader.read_string(reader) 10812 elif tag == 'name': 10813 obj.name = Reader.read_string(reader) 10814 elif tag == 'nic': 10815 obj.nic = NicReader.read_one(reader) 10816 elif tag == 'value': 10817 obj.value = Reader.read_string(reader) 10818 else: 10819 reader.next_element() 10820 for link in links: 10821 NetworkFilterParameterReader._process_link(link, obj) 10822 10823 # Discard the end tag: 10824 reader.read() 10825 10826 return obj
10828 @staticmethod 10829 def read_many(reader): 10830 # Do nothing if there aren't more tags: 10831 objs = List() 10832 if not reader.forward(): 10833 return objs 10834 10835 # Process the attributes: 10836 objs.href = reader.get_attribute('href') 10837 10838 # Discard the start tag: 10839 empty = reader.empty_element() 10840 reader.read() 10841 if empty: 10842 return objs 10843 10844 # Process the inner elements: 10845 while reader.forward(): 10846 objs.append(NetworkFilterParameterReader.read_one(reader)) 10847 10848 # Discard the end tag: 10849 reader.read() 10850 10851 return objs
10854class NetworkLabelReader(Reader): 10855 10856 def __init__(self): 10857 super(NetworkLabelReader, self).__init__() 10858 10859 @staticmethod 10860 def read_one(reader): 10861 # Do nothing if there aren't more tags: 10862 if not reader.forward(): 10863 return None 10864 10865 # Create the object: 10866 obj = types.NetworkLabel() 10867 10868 # Process the attributes: 10869 obj.href = reader.get_attribute('href') 10870 value = reader.get_attribute('id') 10871 if value is not None: 10872 obj.id = value 10873 10874 # Discard the start tag: 10875 empty = reader.empty_element() 10876 reader.read() 10877 if empty: 10878 return obj 10879 10880 # Process the inner elements: 10881 links = [] 10882 while reader.forward(): 10883 tag = reader.node_name() 10884 if tag == 'comment': 10885 obj.comment = Reader.read_string(reader) 10886 elif tag == 'description': 10887 obj.description = Reader.read_string(reader) 10888 elif tag == 'host_nic': 10889 obj.host_nic = HostNicReader.read_one(reader) 10890 elif tag == 'name': 10891 obj.name = Reader.read_string(reader) 10892 elif tag == 'network': 10893 obj.network = NetworkReader.read_one(reader) 10894 else: 10895 reader.next_element() 10896 for link in links: 10897 NetworkLabelReader._process_link(link, obj) 10898 10899 # Discard the end tag: 10900 reader.read() 10901 10902 return obj 10903 10904 @staticmethod 10905 def read_many(reader): 10906 # Do nothing if there aren't more tags: 10907 objs = List() 10908 if not reader.forward(): 10909 return objs 10910 10911 # Process the attributes: 10912 objs.href = reader.get_attribute('href') 10913 10914 # Discard the start tag: 10915 empty = reader.empty_element() 10916 reader.read() 10917 if empty: 10918 return objs 10919 10920 # Process the inner elements: 10921 while reader.forward(): 10922 objs.append(NetworkLabelReader.read_one(reader)) 10923 10924 # Discard the end tag: 10925 reader.read() 10926 10927 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10859 @staticmethod 10860 def read_one(reader): 10861 # Do nothing if there aren't more tags: 10862 if not reader.forward(): 10863 return None 10864 10865 # Create the object: 10866 obj = types.NetworkLabel() 10867 10868 # Process the attributes: 10869 obj.href = reader.get_attribute('href') 10870 value = reader.get_attribute('id') 10871 if value is not None: 10872 obj.id = value 10873 10874 # Discard the start tag: 10875 empty = reader.empty_element() 10876 reader.read() 10877 if empty: 10878 return obj 10879 10880 # Process the inner elements: 10881 links = [] 10882 while reader.forward(): 10883 tag = reader.node_name() 10884 if tag == 'comment': 10885 obj.comment = Reader.read_string(reader) 10886 elif tag == 'description': 10887 obj.description = Reader.read_string(reader) 10888 elif tag == 'host_nic': 10889 obj.host_nic = HostNicReader.read_one(reader) 10890 elif tag == 'name': 10891 obj.name = Reader.read_string(reader) 10892 elif tag == 'network': 10893 obj.network = NetworkReader.read_one(reader) 10894 else: 10895 reader.next_element() 10896 for link in links: 10897 NetworkLabelReader._process_link(link, obj) 10898 10899 # Discard the end tag: 10900 reader.read() 10901 10902 return obj
10904 @staticmethod 10905 def read_many(reader): 10906 # Do nothing if there aren't more tags: 10907 objs = List() 10908 if not reader.forward(): 10909 return objs 10910 10911 # Process the attributes: 10912 objs.href = reader.get_attribute('href') 10913 10914 # Discard the start tag: 10915 empty = reader.empty_element() 10916 reader.read() 10917 if empty: 10918 return objs 10919 10920 # Process the inner elements: 10921 while reader.forward(): 10922 objs.append(NetworkLabelReader.read_one(reader)) 10923 10924 # Discard the end tag: 10925 reader.read() 10926 10927 return objs
10930class NfsProfileDetailReader(Reader): 10931 10932 def __init__(self): 10933 super(NfsProfileDetailReader, self).__init__() 10934 10935 @staticmethod 10936 def read_one(reader): 10937 # Do nothing if there aren't more tags: 10938 if not reader.forward(): 10939 return None 10940 10941 # Create the object: 10942 obj = types.NfsProfileDetail() 10943 10944 # Process the attributes: 10945 obj.href = reader.get_attribute('href') 10946 10947 # Discard the start tag: 10948 empty = reader.empty_element() 10949 reader.read() 10950 if empty: 10951 return obj 10952 10953 # Process the inner elements: 10954 links = [] 10955 while reader.forward(): 10956 tag = reader.node_name() 10957 if tag == 'nfs_server_ip': 10958 obj.nfs_server_ip = Reader.read_string(reader) 10959 elif tag == 'profile_details': 10960 obj.profile_details = ProfileDetailReader.read_many(reader) 10961 else: 10962 reader.next_element() 10963 for link in links: 10964 NfsProfileDetailReader._process_link(link, obj) 10965 10966 # Discard the end tag: 10967 reader.read() 10968 10969 return obj 10970 10971 @staticmethod 10972 def read_many(reader): 10973 # Do nothing if there aren't more tags: 10974 objs = List() 10975 if not reader.forward(): 10976 return objs 10977 10978 # Process the attributes: 10979 objs.href = reader.get_attribute('href') 10980 10981 # Discard the start tag: 10982 empty = reader.empty_element() 10983 reader.read() 10984 if empty: 10985 return objs 10986 10987 # Process the inner elements: 10988 while reader.forward(): 10989 objs.append(NfsProfileDetailReader.read_one(reader)) 10990 10991 # Discard the end tag: 10992 reader.read() 10993 10994 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
10935 @staticmethod 10936 def read_one(reader): 10937 # Do nothing if there aren't more tags: 10938 if not reader.forward(): 10939 return None 10940 10941 # Create the object: 10942 obj = types.NfsProfileDetail() 10943 10944 # Process the attributes: 10945 obj.href = reader.get_attribute('href') 10946 10947 # Discard the start tag: 10948 empty = reader.empty_element() 10949 reader.read() 10950 if empty: 10951 return obj 10952 10953 # Process the inner elements: 10954 links = [] 10955 while reader.forward(): 10956 tag = reader.node_name() 10957 if tag == 'nfs_server_ip': 10958 obj.nfs_server_ip = Reader.read_string(reader) 10959 elif tag == 'profile_details': 10960 obj.profile_details = ProfileDetailReader.read_many(reader) 10961 else: 10962 reader.next_element() 10963 for link in links: 10964 NfsProfileDetailReader._process_link(link, obj) 10965 10966 # Discard the end tag: 10967 reader.read() 10968 10969 return obj
10971 @staticmethod 10972 def read_many(reader): 10973 # Do nothing if there aren't more tags: 10974 objs = List() 10975 if not reader.forward(): 10976 return objs 10977 10978 # Process the attributes: 10979 objs.href = reader.get_attribute('href') 10980 10981 # Discard the start tag: 10982 empty = reader.empty_element() 10983 reader.read() 10984 if empty: 10985 return objs 10986 10987 # Process the inner elements: 10988 while reader.forward(): 10989 objs.append(NfsProfileDetailReader.read_one(reader)) 10990 10991 # Discard the end tag: 10992 reader.read() 10993 10994 return objs
10997class NicReader(Reader): 10998 10999 def __init__(self): 11000 super(NicReader, self).__init__() 11001 11002 @staticmethod 11003 def read_one(reader): 11004 # Do nothing if there aren't more tags: 11005 if not reader.forward(): 11006 return None 11007 11008 # Create the object: 11009 obj = types.Nic() 11010 11011 # Process the attributes: 11012 obj.href = reader.get_attribute('href') 11013 value = reader.get_attribute('id') 11014 if value is not None: 11015 obj.id = value 11016 11017 # Discard the start tag: 11018 empty = reader.empty_element() 11019 reader.read() 11020 if empty: 11021 return obj 11022 11023 # Process the inner elements: 11024 links = [] 11025 while reader.forward(): 11026 tag = reader.node_name() 11027 if tag == 'boot_protocol': 11028 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11029 elif tag == 'comment': 11030 obj.comment = Reader.read_string(reader) 11031 elif tag == 'description': 11032 obj.description = Reader.read_string(reader) 11033 elif tag == 'instance_type': 11034 obj.instance_type = InstanceTypeReader.read_one(reader) 11035 elif tag == 'interface': 11036 obj.interface = Reader.read_enum(types.NicInterface, reader) 11037 elif tag == 'linked': 11038 obj.linked = Reader.read_boolean(reader) 11039 elif tag == 'mac': 11040 obj.mac = MacReader.read_one(reader) 11041 elif tag == 'name': 11042 obj.name = Reader.read_string(reader) 11043 elif tag == 'network': 11044 obj.network = NetworkReader.read_one(reader) 11045 elif tag == 'network_attachments': 11046 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 11047 elif tag == 'network_filter_parameters': 11048 obj.network_filter_parameters = NetworkFilterParameterReader.read_many(reader) 11049 elif tag == 'network_labels': 11050 obj.network_labels = NetworkLabelReader.read_many(reader) 11051 elif tag == 'on_boot': 11052 obj.on_boot = Reader.read_boolean(reader) 11053 elif tag == 'plugged': 11054 obj.plugged = Reader.read_boolean(reader) 11055 elif tag == 'reported_devices': 11056 obj.reported_devices = ReportedDeviceReader.read_many(reader) 11057 elif tag == 'statistics': 11058 obj.statistics = StatisticReader.read_many(reader) 11059 elif tag == 'synced': 11060 obj.synced = Reader.read_boolean(reader) 11061 elif tag == 'template': 11062 obj.template = TemplateReader.read_one(reader) 11063 elif tag == 'virtual_function_allowed_labels': 11064 obj.virtual_function_allowed_labels = NetworkLabelReader.read_many(reader) 11065 elif tag == 'virtual_function_allowed_networks': 11066 obj.virtual_function_allowed_networks = NetworkReader.read_many(reader) 11067 elif tag == 'vm': 11068 obj.vm = VmReader.read_one(reader) 11069 elif tag == 'vms': 11070 obj.vms = VmReader.read_many(reader) 11071 elif tag == 'vnic_profile': 11072 obj.vnic_profile = VnicProfileReader.read_one(reader) 11073 elif tag == 'link': 11074 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11075 reader.next_element() 11076 else: 11077 reader.next_element() 11078 for link in links: 11079 NicReader._process_link(link, obj) 11080 11081 # Discard the end tag: 11082 reader.read() 11083 11084 return obj 11085 11086 @staticmethod 11087 def read_many(reader): 11088 # Do nothing if there aren't more tags: 11089 objs = List() 11090 if not reader.forward(): 11091 return objs 11092 11093 # Process the attributes: 11094 objs.href = reader.get_attribute('href') 11095 11096 # Discard the start tag: 11097 empty = reader.empty_element() 11098 reader.read() 11099 if empty: 11100 return objs 11101 11102 # Process the inner elements: 11103 while reader.forward(): 11104 objs.append(NicReader.read_one(reader)) 11105 11106 # Discard the end tag: 11107 reader.read() 11108 11109 return objs 11110 11111 @staticmethod 11112 def _process_link(link, obj): 11113 # Process the attributes: 11114 rel = link[0] 11115 href = link[1] 11116 if href and rel: 11117 if rel == "networkattachments": 11118 if obj.network_attachments is not None: 11119 obj.network_attachments.href = href 11120 else: 11121 obj.network_attachments = List(href) 11122 elif rel == "networkfilterparameters": 11123 if obj.network_filter_parameters is not None: 11124 obj.network_filter_parameters.href = href 11125 else: 11126 obj.network_filter_parameters = List(href) 11127 elif rel == "networklabels": 11128 if obj.network_labels is not None: 11129 obj.network_labels.href = href 11130 else: 11131 obj.network_labels = List(href) 11132 elif rel == "reporteddevices": 11133 if obj.reported_devices is not None: 11134 obj.reported_devices.href = href 11135 else: 11136 obj.reported_devices = List(href) 11137 elif rel == "statistics": 11138 if obj.statistics is not None: 11139 obj.statistics.href = href 11140 else: 11141 obj.statistics = List(href) 11142 elif rel == "virtualfunctionallowedlabels": 11143 if obj.virtual_function_allowed_labels is not None: 11144 obj.virtual_function_allowed_labels.href = href 11145 else: 11146 obj.virtual_function_allowed_labels = List(href) 11147 elif rel == "virtualfunctionallowednetworks": 11148 if obj.virtual_function_allowed_networks is not None: 11149 obj.virtual_function_allowed_networks.href = href 11150 else: 11151 obj.virtual_function_allowed_networks = List(href) 11152 elif rel == "vms": 11153 if obj.vms is not None: 11154 obj.vms.href = href 11155 else: 11156 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11002 @staticmethod 11003 def read_one(reader): 11004 # Do nothing if there aren't more tags: 11005 if not reader.forward(): 11006 return None 11007 11008 # Create the object: 11009 obj = types.Nic() 11010 11011 # Process the attributes: 11012 obj.href = reader.get_attribute('href') 11013 value = reader.get_attribute('id') 11014 if value is not None: 11015 obj.id = value 11016 11017 # Discard the start tag: 11018 empty = reader.empty_element() 11019 reader.read() 11020 if empty: 11021 return obj 11022 11023 # Process the inner elements: 11024 links = [] 11025 while reader.forward(): 11026 tag = reader.node_name() 11027 if tag == 'boot_protocol': 11028 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11029 elif tag == 'comment': 11030 obj.comment = Reader.read_string(reader) 11031 elif tag == 'description': 11032 obj.description = Reader.read_string(reader) 11033 elif tag == 'instance_type': 11034 obj.instance_type = InstanceTypeReader.read_one(reader) 11035 elif tag == 'interface': 11036 obj.interface = Reader.read_enum(types.NicInterface, reader) 11037 elif tag == 'linked': 11038 obj.linked = Reader.read_boolean(reader) 11039 elif tag == 'mac': 11040 obj.mac = MacReader.read_one(reader) 11041 elif tag == 'name': 11042 obj.name = Reader.read_string(reader) 11043 elif tag == 'network': 11044 obj.network = NetworkReader.read_one(reader) 11045 elif tag == 'network_attachments': 11046 obj.network_attachments = NetworkAttachmentReader.read_many(reader) 11047 elif tag == 'network_filter_parameters': 11048 obj.network_filter_parameters = NetworkFilterParameterReader.read_many(reader) 11049 elif tag == 'network_labels': 11050 obj.network_labels = NetworkLabelReader.read_many(reader) 11051 elif tag == 'on_boot': 11052 obj.on_boot = Reader.read_boolean(reader) 11053 elif tag == 'plugged': 11054 obj.plugged = Reader.read_boolean(reader) 11055 elif tag == 'reported_devices': 11056 obj.reported_devices = ReportedDeviceReader.read_many(reader) 11057 elif tag == 'statistics': 11058 obj.statistics = StatisticReader.read_many(reader) 11059 elif tag == 'synced': 11060 obj.synced = Reader.read_boolean(reader) 11061 elif tag == 'template': 11062 obj.template = TemplateReader.read_one(reader) 11063 elif tag == 'virtual_function_allowed_labels': 11064 obj.virtual_function_allowed_labels = NetworkLabelReader.read_many(reader) 11065 elif tag == 'virtual_function_allowed_networks': 11066 obj.virtual_function_allowed_networks = NetworkReader.read_many(reader) 11067 elif tag == 'vm': 11068 obj.vm = VmReader.read_one(reader) 11069 elif tag == 'vms': 11070 obj.vms = VmReader.read_many(reader) 11071 elif tag == 'vnic_profile': 11072 obj.vnic_profile = VnicProfileReader.read_one(reader) 11073 elif tag == 'link': 11074 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11075 reader.next_element() 11076 else: 11077 reader.next_element() 11078 for link in links: 11079 NicReader._process_link(link, obj) 11080 11081 # Discard the end tag: 11082 reader.read() 11083 11084 return obj
11086 @staticmethod 11087 def read_many(reader): 11088 # Do nothing if there aren't more tags: 11089 objs = List() 11090 if not reader.forward(): 11091 return objs 11092 11093 # Process the attributes: 11094 objs.href = reader.get_attribute('href') 11095 11096 # Discard the start tag: 11097 empty = reader.empty_element() 11098 reader.read() 11099 if empty: 11100 return objs 11101 11102 # Process the inner elements: 11103 while reader.forward(): 11104 objs.append(NicReader.read_one(reader)) 11105 11106 # Discard the end tag: 11107 reader.read() 11108 11109 return objs
11159class NicConfigurationReader(Reader): 11160 11161 def __init__(self): 11162 super(NicConfigurationReader, self).__init__() 11163 11164 @staticmethod 11165 def read_one(reader): 11166 # Do nothing if there aren't more tags: 11167 if not reader.forward(): 11168 return None 11169 11170 # Create the object: 11171 obj = types.NicConfiguration() 11172 11173 # Process the attributes: 11174 obj.href = reader.get_attribute('href') 11175 11176 # Discard the start tag: 11177 empty = reader.empty_element() 11178 reader.read() 11179 if empty: 11180 return obj 11181 11182 # Process the inner elements: 11183 links = [] 11184 while reader.forward(): 11185 tag = reader.node_name() 11186 if tag == 'boot_protocol': 11187 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11188 elif tag == 'ip': 11189 obj.ip = IpReader.read_one(reader) 11190 elif tag == 'ipv6': 11191 obj.ipv6 = IpReader.read_one(reader) 11192 elif tag == 'ipv6_boot_protocol': 11193 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11194 elif tag == 'name': 11195 obj.name = Reader.read_string(reader) 11196 elif tag == 'on_boot': 11197 obj.on_boot = Reader.read_boolean(reader) 11198 else: 11199 reader.next_element() 11200 for link in links: 11201 NicConfigurationReader._process_link(link, obj) 11202 11203 # Discard the end tag: 11204 reader.read() 11205 11206 return obj 11207 11208 @staticmethod 11209 def read_many(reader): 11210 # Do nothing if there aren't more tags: 11211 objs = List() 11212 if not reader.forward(): 11213 return objs 11214 11215 # Process the attributes: 11216 objs.href = reader.get_attribute('href') 11217 11218 # Discard the start tag: 11219 empty = reader.empty_element() 11220 reader.read() 11221 if empty: 11222 return objs 11223 11224 # Process the inner elements: 11225 while reader.forward(): 11226 objs.append(NicConfigurationReader.read_one(reader)) 11227 11228 # Discard the end tag: 11229 reader.read() 11230 11231 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11164 @staticmethod 11165 def read_one(reader): 11166 # Do nothing if there aren't more tags: 11167 if not reader.forward(): 11168 return None 11169 11170 # Create the object: 11171 obj = types.NicConfiguration() 11172 11173 # Process the attributes: 11174 obj.href = reader.get_attribute('href') 11175 11176 # Discard the start tag: 11177 empty = reader.empty_element() 11178 reader.read() 11179 if empty: 11180 return obj 11181 11182 # Process the inner elements: 11183 links = [] 11184 while reader.forward(): 11185 tag = reader.node_name() 11186 if tag == 'boot_protocol': 11187 obj.boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11188 elif tag == 'ip': 11189 obj.ip = IpReader.read_one(reader) 11190 elif tag == 'ipv6': 11191 obj.ipv6 = IpReader.read_one(reader) 11192 elif tag == 'ipv6_boot_protocol': 11193 obj.ipv6_boot_protocol = Reader.read_enum(types.BootProtocol, reader) 11194 elif tag == 'name': 11195 obj.name = Reader.read_string(reader) 11196 elif tag == 'on_boot': 11197 obj.on_boot = Reader.read_boolean(reader) 11198 else: 11199 reader.next_element() 11200 for link in links: 11201 NicConfigurationReader._process_link(link, obj) 11202 11203 # Discard the end tag: 11204 reader.read() 11205 11206 return obj
11208 @staticmethod 11209 def read_many(reader): 11210 # Do nothing if there aren't more tags: 11211 objs = List() 11212 if not reader.forward(): 11213 return objs 11214 11215 # Process the attributes: 11216 objs.href = reader.get_attribute('href') 11217 11218 # Discard the start tag: 11219 empty = reader.empty_element() 11220 reader.read() 11221 if empty: 11222 return objs 11223 11224 # Process the inner elements: 11225 while reader.forward(): 11226 objs.append(NicConfigurationReader.read_one(reader)) 11227 11228 # Discard the end tag: 11229 reader.read() 11230 11231 return objs
11234class NumaNodeReader(Reader): 11235 11236 def __init__(self): 11237 super(NumaNodeReader, self).__init__() 11238 11239 @staticmethod 11240 def read_one(reader): 11241 # Do nothing if there aren't more tags: 11242 if not reader.forward(): 11243 return None 11244 11245 # Create the object: 11246 obj = types.NumaNode() 11247 11248 # Process the attributes: 11249 obj.href = reader.get_attribute('href') 11250 value = reader.get_attribute('id') 11251 if value is not None: 11252 obj.id = value 11253 11254 # Discard the start tag: 11255 empty = reader.empty_element() 11256 reader.read() 11257 if empty: 11258 return obj 11259 11260 # Process the inner elements: 11261 links = [] 11262 while reader.forward(): 11263 tag = reader.node_name() 11264 if tag == 'comment': 11265 obj.comment = Reader.read_string(reader) 11266 elif tag == 'cpu': 11267 obj.cpu = CpuReader.read_one(reader) 11268 elif tag == 'description': 11269 obj.description = Reader.read_string(reader) 11270 elif tag == 'host': 11271 obj.host = HostReader.read_one(reader) 11272 elif tag == 'index': 11273 obj.index = Reader.read_integer(reader) 11274 elif tag == 'memory': 11275 obj.memory = Reader.read_integer(reader) 11276 elif tag == 'name': 11277 obj.name = Reader.read_string(reader) 11278 elif tag == 'node_distance': 11279 obj.node_distance = Reader.read_string(reader) 11280 elif tag == 'statistics': 11281 obj.statistics = StatisticReader.read_many(reader) 11282 elif tag == 'link': 11283 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11284 reader.next_element() 11285 else: 11286 reader.next_element() 11287 for link in links: 11288 NumaNodeReader._process_link(link, obj) 11289 11290 # Discard the end tag: 11291 reader.read() 11292 11293 return obj 11294 11295 @staticmethod 11296 def read_many(reader): 11297 # Do nothing if there aren't more tags: 11298 objs = List() 11299 if not reader.forward(): 11300 return objs 11301 11302 # Process the attributes: 11303 objs.href = reader.get_attribute('href') 11304 11305 # Discard the start tag: 11306 empty = reader.empty_element() 11307 reader.read() 11308 if empty: 11309 return objs 11310 11311 # Process the inner elements: 11312 while reader.forward(): 11313 objs.append(NumaNodeReader.read_one(reader)) 11314 11315 # Discard the end tag: 11316 reader.read() 11317 11318 return objs 11319 11320 @staticmethod 11321 def _process_link(link, obj): 11322 # Process the attributes: 11323 rel = link[0] 11324 href = link[1] 11325 if href and rel: 11326 if rel == "statistics": 11327 if obj.statistics is not None: 11328 obj.statistics.href = href 11329 else: 11330 obj.statistics = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11239 @staticmethod 11240 def read_one(reader): 11241 # Do nothing if there aren't more tags: 11242 if not reader.forward(): 11243 return None 11244 11245 # Create the object: 11246 obj = types.NumaNode() 11247 11248 # Process the attributes: 11249 obj.href = reader.get_attribute('href') 11250 value = reader.get_attribute('id') 11251 if value is not None: 11252 obj.id = value 11253 11254 # Discard the start tag: 11255 empty = reader.empty_element() 11256 reader.read() 11257 if empty: 11258 return obj 11259 11260 # Process the inner elements: 11261 links = [] 11262 while reader.forward(): 11263 tag = reader.node_name() 11264 if tag == 'comment': 11265 obj.comment = Reader.read_string(reader) 11266 elif tag == 'cpu': 11267 obj.cpu = CpuReader.read_one(reader) 11268 elif tag == 'description': 11269 obj.description = Reader.read_string(reader) 11270 elif tag == 'host': 11271 obj.host = HostReader.read_one(reader) 11272 elif tag == 'index': 11273 obj.index = Reader.read_integer(reader) 11274 elif tag == 'memory': 11275 obj.memory = Reader.read_integer(reader) 11276 elif tag == 'name': 11277 obj.name = Reader.read_string(reader) 11278 elif tag == 'node_distance': 11279 obj.node_distance = Reader.read_string(reader) 11280 elif tag == 'statistics': 11281 obj.statistics = StatisticReader.read_many(reader) 11282 elif tag == 'link': 11283 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11284 reader.next_element() 11285 else: 11286 reader.next_element() 11287 for link in links: 11288 NumaNodeReader._process_link(link, obj) 11289 11290 # Discard the end tag: 11291 reader.read() 11292 11293 return obj
11295 @staticmethod 11296 def read_many(reader): 11297 # Do nothing if there aren't more tags: 11298 objs = List() 11299 if not reader.forward(): 11300 return objs 11301 11302 # Process the attributes: 11303 objs.href = reader.get_attribute('href') 11304 11305 # Discard the start tag: 11306 empty = reader.empty_element() 11307 reader.read() 11308 if empty: 11309 return objs 11310 11311 # Process the inner elements: 11312 while reader.forward(): 11313 objs.append(NumaNodeReader.read_one(reader)) 11314 11315 # Discard the end tag: 11316 reader.read() 11317 11318 return objs
11333class NumaNodePinReader(Reader): 11334 11335 def __init__(self): 11336 super(NumaNodePinReader, self).__init__() 11337 11338 @staticmethod 11339 def read_one(reader): 11340 # Do nothing if there aren't more tags: 11341 if not reader.forward(): 11342 return None 11343 11344 # Create the object: 11345 obj = types.NumaNodePin() 11346 11347 # Process the attributes: 11348 obj.href = reader.get_attribute('href') 11349 11350 # Discard the start tag: 11351 empty = reader.empty_element() 11352 reader.read() 11353 if empty: 11354 return obj 11355 11356 # Process the inner elements: 11357 links = [] 11358 while reader.forward(): 11359 tag = reader.node_name() 11360 if tag == 'host_numa_node': 11361 obj.host_numa_node = NumaNodeReader.read_one(reader) 11362 elif tag == 'index': 11363 obj.index = Reader.read_integer(reader) 11364 elif tag == 'pinned': 11365 obj.pinned = Reader.read_boolean(reader) 11366 else: 11367 reader.next_element() 11368 for link in links: 11369 NumaNodePinReader._process_link(link, obj) 11370 11371 # Discard the end tag: 11372 reader.read() 11373 11374 return obj 11375 11376 @staticmethod 11377 def read_many(reader): 11378 # Do nothing if there aren't more tags: 11379 objs = List() 11380 if not reader.forward(): 11381 return objs 11382 11383 # Process the attributes: 11384 objs.href = reader.get_attribute('href') 11385 11386 # Discard the start tag: 11387 empty = reader.empty_element() 11388 reader.read() 11389 if empty: 11390 return objs 11391 11392 # Process the inner elements: 11393 while reader.forward(): 11394 objs.append(NumaNodePinReader.read_one(reader)) 11395 11396 # Discard the end tag: 11397 reader.read() 11398 11399 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11338 @staticmethod 11339 def read_one(reader): 11340 # Do nothing if there aren't more tags: 11341 if not reader.forward(): 11342 return None 11343 11344 # Create the object: 11345 obj = types.NumaNodePin() 11346 11347 # Process the attributes: 11348 obj.href = reader.get_attribute('href') 11349 11350 # Discard the start tag: 11351 empty = reader.empty_element() 11352 reader.read() 11353 if empty: 11354 return obj 11355 11356 # Process the inner elements: 11357 links = [] 11358 while reader.forward(): 11359 tag = reader.node_name() 11360 if tag == 'host_numa_node': 11361 obj.host_numa_node = NumaNodeReader.read_one(reader) 11362 elif tag == 'index': 11363 obj.index = Reader.read_integer(reader) 11364 elif tag == 'pinned': 11365 obj.pinned = Reader.read_boolean(reader) 11366 else: 11367 reader.next_element() 11368 for link in links: 11369 NumaNodePinReader._process_link(link, obj) 11370 11371 # Discard the end tag: 11372 reader.read() 11373 11374 return obj
11376 @staticmethod 11377 def read_many(reader): 11378 # Do nothing if there aren't more tags: 11379 objs = List() 11380 if not reader.forward(): 11381 return objs 11382 11383 # Process the attributes: 11384 objs.href = reader.get_attribute('href') 11385 11386 # Discard the start tag: 11387 empty = reader.empty_element() 11388 reader.read() 11389 if empty: 11390 return objs 11391 11392 # Process the inner elements: 11393 while reader.forward(): 11394 objs.append(NumaNodePinReader.read_one(reader)) 11395 11396 # Discard the end tag: 11397 reader.read() 11398 11399 return objs
11402class OpenStackImageReader(Reader): 11403 11404 def __init__(self): 11405 super(OpenStackImageReader, self).__init__() 11406 11407 @staticmethod 11408 def read_one(reader): 11409 # Do nothing if there aren't more tags: 11410 if not reader.forward(): 11411 return None 11412 11413 # Create the object: 11414 obj = types.OpenStackImage() 11415 11416 # Process the attributes: 11417 obj.href = reader.get_attribute('href') 11418 value = reader.get_attribute('id') 11419 if value is not None: 11420 obj.id = value 11421 11422 # Discard the start tag: 11423 empty = reader.empty_element() 11424 reader.read() 11425 if empty: 11426 return obj 11427 11428 # Process the inner elements: 11429 links = [] 11430 while reader.forward(): 11431 tag = reader.node_name() 11432 if tag == 'comment': 11433 obj.comment = Reader.read_string(reader) 11434 elif tag == 'description': 11435 obj.description = Reader.read_string(reader) 11436 elif tag == 'name': 11437 obj.name = Reader.read_string(reader) 11438 elif tag == 'openstack_image_provider': 11439 obj.openstack_image_provider = OpenStackImageProviderReader.read_one(reader) 11440 else: 11441 reader.next_element() 11442 for link in links: 11443 OpenStackImageReader._process_link(link, obj) 11444 11445 # Discard the end tag: 11446 reader.read() 11447 11448 return obj 11449 11450 @staticmethod 11451 def read_many(reader): 11452 # Do nothing if there aren't more tags: 11453 objs = List() 11454 if not reader.forward(): 11455 return objs 11456 11457 # Process the attributes: 11458 objs.href = reader.get_attribute('href') 11459 11460 # Discard the start tag: 11461 empty = reader.empty_element() 11462 reader.read() 11463 if empty: 11464 return objs 11465 11466 # Process the inner elements: 11467 while reader.forward(): 11468 objs.append(OpenStackImageReader.read_one(reader)) 11469 11470 # Discard the end tag: 11471 reader.read() 11472 11473 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11407 @staticmethod 11408 def read_one(reader): 11409 # Do nothing if there aren't more tags: 11410 if not reader.forward(): 11411 return None 11412 11413 # Create the object: 11414 obj = types.OpenStackImage() 11415 11416 # Process the attributes: 11417 obj.href = reader.get_attribute('href') 11418 value = reader.get_attribute('id') 11419 if value is not None: 11420 obj.id = value 11421 11422 # Discard the start tag: 11423 empty = reader.empty_element() 11424 reader.read() 11425 if empty: 11426 return obj 11427 11428 # Process the inner elements: 11429 links = [] 11430 while reader.forward(): 11431 tag = reader.node_name() 11432 if tag == 'comment': 11433 obj.comment = Reader.read_string(reader) 11434 elif tag == 'description': 11435 obj.description = Reader.read_string(reader) 11436 elif tag == 'name': 11437 obj.name = Reader.read_string(reader) 11438 elif tag == 'openstack_image_provider': 11439 obj.openstack_image_provider = OpenStackImageProviderReader.read_one(reader) 11440 else: 11441 reader.next_element() 11442 for link in links: 11443 OpenStackImageReader._process_link(link, obj) 11444 11445 # Discard the end tag: 11446 reader.read() 11447 11448 return obj
11450 @staticmethod 11451 def read_many(reader): 11452 # Do nothing if there aren't more tags: 11453 objs = List() 11454 if not reader.forward(): 11455 return objs 11456 11457 # Process the attributes: 11458 objs.href = reader.get_attribute('href') 11459 11460 # Discard the start tag: 11461 empty = reader.empty_element() 11462 reader.read() 11463 if empty: 11464 return objs 11465 11466 # Process the inner elements: 11467 while reader.forward(): 11468 objs.append(OpenStackImageReader.read_one(reader)) 11469 11470 # Discard the end tag: 11471 reader.read() 11472 11473 return objs
11476class OpenStackImageProviderReader(Reader): 11477 11478 def __init__(self): 11479 super(OpenStackImageProviderReader, self).__init__() 11480 11481 @staticmethod 11482 def read_one(reader): 11483 # Do nothing if there aren't more tags: 11484 if not reader.forward(): 11485 return None 11486 11487 # Create the object: 11488 obj = types.OpenStackImageProvider() 11489 11490 # Process the attributes: 11491 obj.href = reader.get_attribute('href') 11492 value = reader.get_attribute('id') 11493 if value is not None: 11494 obj.id = value 11495 11496 # Discard the start tag: 11497 empty = reader.empty_element() 11498 reader.read() 11499 if empty: 11500 return obj 11501 11502 # Process the inner elements: 11503 links = [] 11504 while reader.forward(): 11505 tag = reader.node_name() 11506 if tag == 'authentication_url': 11507 obj.authentication_url = Reader.read_string(reader) 11508 elif tag == 'certificates': 11509 obj.certificates = CertificateReader.read_many(reader) 11510 elif tag == 'comment': 11511 obj.comment = Reader.read_string(reader) 11512 elif tag == 'description': 11513 obj.description = Reader.read_string(reader) 11514 elif tag == 'images': 11515 obj.images = OpenStackImageReader.read_many(reader) 11516 elif tag == 'name': 11517 obj.name = Reader.read_string(reader) 11518 elif tag == 'password': 11519 obj.password = Reader.read_string(reader) 11520 elif tag == 'properties': 11521 obj.properties = PropertyReader.read_many(reader) 11522 elif tag == 'requires_authentication': 11523 obj.requires_authentication = Reader.read_boolean(reader) 11524 elif tag == 'tenant_name': 11525 obj.tenant_name = Reader.read_string(reader) 11526 elif tag == 'url': 11527 obj.url = Reader.read_string(reader) 11528 elif tag == 'username': 11529 obj.username = Reader.read_string(reader) 11530 elif tag == 'link': 11531 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11532 reader.next_element() 11533 else: 11534 reader.next_element() 11535 for link in links: 11536 OpenStackImageProviderReader._process_link(link, obj) 11537 11538 # Discard the end tag: 11539 reader.read() 11540 11541 return obj 11542 11543 @staticmethod 11544 def read_many(reader): 11545 # Do nothing if there aren't more tags: 11546 objs = List() 11547 if not reader.forward(): 11548 return objs 11549 11550 # Process the attributes: 11551 objs.href = reader.get_attribute('href') 11552 11553 # Discard the start tag: 11554 empty = reader.empty_element() 11555 reader.read() 11556 if empty: 11557 return objs 11558 11559 # Process the inner elements: 11560 while reader.forward(): 11561 objs.append(OpenStackImageProviderReader.read_one(reader)) 11562 11563 # Discard the end tag: 11564 reader.read() 11565 11566 return objs 11567 11568 @staticmethod 11569 def _process_link(link, obj): 11570 # Process the attributes: 11571 rel = link[0] 11572 href = link[1] 11573 if href and rel: 11574 if rel == "certificates": 11575 if obj.certificates is not None: 11576 obj.certificates.href = href 11577 else: 11578 obj.certificates = List(href) 11579 elif rel == "images": 11580 if obj.images is not None: 11581 obj.images.href = href 11582 else: 11583 obj.images = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11481 @staticmethod 11482 def read_one(reader): 11483 # Do nothing if there aren't more tags: 11484 if not reader.forward(): 11485 return None 11486 11487 # Create the object: 11488 obj = types.OpenStackImageProvider() 11489 11490 # Process the attributes: 11491 obj.href = reader.get_attribute('href') 11492 value = reader.get_attribute('id') 11493 if value is not None: 11494 obj.id = value 11495 11496 # Discard the start tag: 11497 empty = reader.empty_element() 11498 reader.read() 11499 if empty: 11500 return obj 11501 11502 # Process the inner elements: 11503 links = [] 11504 while reader.forward(): 11505 tag = reader.node_name() 11506 if tag == 'authentication_url': 11507 obj.authentication_url = Reader.read_string(reader) 11508 elif tag == 'certificates': 11509 obj.certificates = CertificateReader.read_many(reader) 11510 elif tag == 'comment': 11511 obj.comment = Reader.read_string(reader) 11512 elif tag == 'description': 11513 obj.description = Reader.read_string(reader) 11514 elif tag == 'images': 11515 obj.images = OpenStackImageReader.read_many(reader) 11516 elif tag == 'name': 11517 obj.name = Reader.read_string(reader) 11518 elif tag == 'password': 11519 obj.password = Reader.read_string(reader) 11520 elif tag == 'properties': 11521 obj.properties = PropertyReader.read_many(reader) 11522 elif tag == 'requires_authentication': 11523 obj.requires_authentication = Reader.read_boolean(reader) 11524 elif tag == 'tenant_name': 11525 obj.tenant_name = Reader.read_string(reader) 11526 elif tag == 'url': 11527 obj.url = Reader.read_string(reader) 11528 elif tag == 'username': 11529 obj.username = Reader.read_string(reader) 11530 elif tag == 'link': 11531 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11532 reader.next_element() 11533 else: 11534 reader.next_element() 11535 for link in links: 11536 OpenStackImageProviderReader._process_link(link, obj) 11537 11538 # Discard the end tag: 11539 reader.read() 11540 11541 return obj
11543 @staticmethod 11544 def read_many(reader): 11545 # Do nothing if there aren't more tags: 11546 objs = List() 11547 if not reader.forward(): 11548 return objs 11549 11550 # Process the attributes: 11551 objs.href = reader.get_attribute('href') 11552 11553 # Discard the start tag: 11554 empty = reader.empty_element() 11555 reader.read() 11556 if empty: 11557 return objs 11558 11559 # Process the inner elements: 11560 while reader.forward(): 11561 objs.append(OpenStackImageProviderReader.read_one(reader)) 11562 11563 # Discard the end tag: 11564 reader.read() 11565 11566 return objs
11586class OpenStackNetworkReader(Reader): 11587 11588 def __init__(self): 11589 super(OpenStackNetworkReader, self).__init__() 11590 11591 @staticmethod 11592 def read_one(reader): 11593 # Do nothing if there aren't more tags: 11594 if not reader.forward(): 11595 return None 11596 11597 # Create the object: 11598 obj = types.OpenStackNetwork() 11599 11600 # Process the attributes: 11601 obj.href = reader.get_attribute('href') 11602 value = reader.get_attribute('id') 11603 if value is not None: 11604 obj.id = value 11605 11606 # Discard the start tag: 11607 empty = reader.empty_element() 11608 reader.read() 11609 if empty: 11610 return obj 11611 11612 # Process the inner elements: 11613 links = [] 11614 while reader.forward(): 11615 tag = reader.node_name() 11616 if tag == 'comment': 11617 obj.comment = Reader.read_string(reader) 11618 elif tag == 'description': 11619 obj.description = Reader.read_string(reader) 11620 elif tag == 'name': 11621 obj.name = Reader.read_string(reader) 11622 elif tag == 'openstack_network_provider': 11623 obj.openstack_network_provider = OpenStackNetworkProviderReader.read_one(reader) 11624 else: 11625 reader.next_element() 11626 for link in links: 11627 OpenStackNetworkReader._process_link(link, obj) 11628 11629 # Discard the end tag: 11630 reader.read() 11631 11632 return obj 11633 11634 @staticmethod 11635 def read_many(reader): 11636 # Do nothing if there aren't more tags: 11637 objs = List() 11638 if not reader.forward(): 11639 return objs 11640 11641 # Process the attributes: 11642 objs.href = reader.get_attribute('href') 11643 11644 # Discard the start tag: 11645 empty = reader.empty_element() 11646 reader.read() 11647 if empty: 11648 return objs 11649 11650 # Process the inner elements: 11651 while reader.forward(): 11652 objs.append(OpenStackNetworkReader.read_one(reader)) 11653 11654 # Discard the end tag: 11655 reader.read() 11656 11657 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11591 @staticmethod 11592 def read_one(reader): 11593 # Do nothing if there aren't more tags: 11594 if not reader.forward(): 11595 return None 11596 11597 # Create the object: 11598 obj = types.OpenStackNetwork() 11599 11600 # Process the attributes: 11601 obj.href = reader.get_attribute('href') 11602 value = reader.get_attribute('id') 11603 if value is not None: 11604 obj.id = value 11605 11606 # Discard the start tag: 11607 empty = reader.empty_element() 11608 reader.read() 11609 if empty: 11610 return obj 11611 11612 # Process the inner elements: 11613 links = [] 11614 while reader.forward(): 11615 tag = reader.node_name() 11616 if tag == 'comment': 11617 obj.comment = Reader.read_string(reader) 11618 elif tag == 'description': 11619 obj.description = Reader.read_string(reader) 11620 elif tag == 'name': 11621 obj.name = Reader.read_string(reader) 11622 elif tag == 'openstack_network_provider': 11623 obj.openstack_network_provider = OpenStackNetworkProviderReader.read_one(reader) 11624 else: 11625 reader.next_element() 11626 for link in links: 11627 OpenStackNetworkReader._process_link(link, obj) 11628 11629 # Discard the end tag: 11630 reader.read() 11631 11632 return obj
11634 @staticmethod 11635 def read_many(reader): 11636 # Do nothing if there aren't more tags: 11637 objs = List() 11638 if not reader.forward(): 11639 return objs 11640 11641 # Process the attributes: 11642 objs.href = reader.get_attribute('href') 11643 11644 # Discard the start tag: 11645 empty = reader.empty_element() 11646 reader.read() 11647 if empty: 11648 return objs 11649 11650 # Process the inner elements: 11651 while reader.forward(): 11652 objs.append(OpenStackNetworkReader.read_one(reader)) 11653 11654 # Discard the end tag: 11655 reader.read() 11656 11657 return objs
11660class OpenStackNetworkProviderReader(Reader): 11661 11662 def __init__(self): 11663 super(OpenStackNetworkProviderReader, self).__init__() 11664 11665 @staticmethod 11666 def read_one(reader): 11667 # Do nothing if there aren't more tags: 11668 if not reader.forward(): 11669 return None 11670 11671 # Create the object: 11672 obj = types.OpenStackNetworkProvider() 11673 11674 # Process the attributes: 11675 obj.href = reader.get_attribute('href') 11676 value = reader.get_attribute('id') 11677 if value is not None: 11678 obj.id = value 11679 11680 # Discard the start tag: 11681 empty = reader.empty_element() 11682 reader.read() 11683 if empty: 11684 return obj 11685 11686 # Process the inner elements: 11687 links = [] 11688 while reader.forward(): 11689 tag = reader.node_name() 11690 if tag == 'agent_configuration': 11691 obj.agent_configuration = AgentConfigurationReader.read_one(reader) 11692 elif tag == 'authentication_url': 11693 obj.authentication_url = Reader.read_string(reader) 11694 elif tag == 'auto_sync': 11695 obj.auto_sync = Reader.read_boolean(reader) 11696 elif tag == 'certificates': 11697 obj.certificates = CertificateReader.read_many(reader) 11698 elif tag == 'comment': 11699 obj.comment = Reader.read_string(reader) 11700 elif tag == 'description': 11701 obj.description = Reader.read_string(reader) 11702 elif tag == 'external_plugin_type': 11703 obj.external_plugin_type = Reader.read_string(reader) 11704 elif tag == 'name': 11705 obj.name = Reader.read_string(reader) 11706 elif tag == 'networks': 11707 obj.networks = OpenStackNetworkReader.read_many(reader) 11708 elif tag == 'password': 11709 obj.password = Reader.read_string(reader) 11710 elif tag == 'plugin_type': 11711 obj.plugin_type = Reader.read_enum(types.NetworkPluginType, reader) 11712 elif tag == 'project_domain_name': 11713 obj.project_domain_name = Reader.read_string(reader) 11714 elif tag == 'project_name': 11715 obj.project_name = Reader.read_string(reader) 11716 elif tag == 'properties': 11717 obj.properties = PropertyReader.read_many(reader) 11718 elif tag == 'read_only': 11719 obj.read_only = Reader.read_boolean(reader) 11720 elif tag == 'requires_authentication': 11721 obj.requires_authentication = Reader.read_boolean(reader) 11722 elif tag == 'subnets': 11723 obj.subnets = OpenStackSubnetReader.read_many(reader) 11724 elif tag == 'tenant_name': 11725 obj.tenant_name = Reader.read_string(reader) 11726 elif tag == 'type': 11727 obj.type = Reader.read_enum(types.OpenStackNetworkProviderType, reader) 11728 elif tag == 'unmanaged': 11729 obj.unmanaged = Reader.read_boolean(reader) 11730 elif tag == 'url': 11731 obj.url = Reader.read_string(reader) 11732 elif tag == 'user_domain_name': 11733 obj.user_domain_name = Reader.read_string(reader) 11734 elif tag == 'username': 11735 obj.username = Reader.read_string(reader) 11736 elif tag == 'link': 11737 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11738 reader.next_element() 11739 else: 11740 reader.next_element() 11741 for link in links: 11742 OpenStackNetworkProviderReader._process_link(link, obj) 11743 11744 # Discard the end tag: 11745 reader.read() 11746 11747 return obj 11748 11749 @staticmethod 11750 def read_many(reader): 11751 # Do nothing if there aren't more tags: 11752 objs = List() 11753 if not reader.forward(): 11754 return objs 11755 11756 # Process the attributes: 11757 objs.href = reader.get_attribute('href') 11758 11759 # Discard the start tag: 11760 empty = reader.empty_element() 11761 reader.read() 11762 if empty: 11763 return objs 11764 11765 # Process the inner elements: 11766 while reader.forward(): 11767 objs.append(OpenStackNetworkProviderReader.read_one(reader)) 11768 11769 # Discard the end tag: 11770 reader.read() 11771 11772 return objs 11773 11774 @staticmethod 11775 def _process_link(link, obj): 11776 # Process the attributes: 11777 rel = link[0] 11778 href = link[1] 11779 if href and rel: 11780 if rel == "certificates": 11781 if obj.certificates is not None: 11782 obj.certificates.href = href 11783 else: 11784 obj.certificates = List(href) 11785 elif rel == "networks": 11786 if obj.networks is not None: 11787 obj.networks.href = href 11788 else: 11789 obj.networks = List(href) 11790 elif rel == "subnets": 11791 if obj.subnets is not None: 11792 obj.subnets.href = href 11793 else: 11794 obj.subnets = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11665 @staticmethod 11666 def read_one(reader): 11667 # Do nothing if there aren't more tags: 11668 if not reader.forward(): 11669 return None 11670 11671 # Create the object: 11672 obj = types.OpenStackNetworkProvider() 11673 11674 # Process the attributes: 11675 obj.href = reader.get_attribute('href') 11676 value = reader.get_attribute('id') 11677 if value is not None: 11678 obj.id = value 11679 11680 # Discard the start tag: 11681 empty = reader.empty_element() 11682 reader.read() 11683 if empty: 11684 return obj 11685 11686 # Process the inner elements: 11687 links = [] 11688 while reader.forward(): 11689 tag = reader.node_name() 11690 if tag == 'agent_configuration': 11691 obj.agent_configuration = AgentConfigurationReader.read_one(reader) 11692 elif tag == 'authentication_url': 11693 obj.authentication_url = Reader.read_string(reader) 11694 elif tag == 'auto_sync': 11695 obj.auto_sync = Reader.read_boolean(reader) 11696 elif tag == 'certificates': 11697 obj.certificates = CertificateReader.read_many(reader) 11698 elif tag == 'comment': 11699 obj.comment = Reader.read_string(reader) 11700 elif tag == 'description': 11701 obj.description = Reader.read_string(reader) 11702 elif tag == 'external_plugin_type': 11703 obj.external_plugin_type = Reader.read_string(reader) 11704 elif tag == 'name': 11705 obj.name = Reader.read_string(reader) 11706 elif tag == 'networks': 11707 obj.networks = OpenStackNetworkReader.read_many(reader) 11708 elif tag == 'password': 11709 obj.password = Reader.read_string(reader) 11710 elif tag == 'plugin_type': 11711 obj.plugin_type = Reader.read_enum(types.NetworkPluginType, reader) 11712 elif tag == 'project_domain_name': 11713 obj.project_domain_name = Reader.read_string(reader) 11714 elif tag == 'project_name': 11715 obj.project_name = Reader.read_string(reader) 11716 elif tag == 'properties': 11717 obj.properties = PropertyReader.read_many(reader) 11718 elif tag == 'read_only': 11719 obj.read_only = Reader.read_boolean(reader) 11720 elif tag == 'requires_authentication': 11721 obj.requires_authentication = Reader.read_boolean(reader) 11722 elif tag == 'subnets': 11723 obj.subnets = OpenStackSubnetReader.read_many(reader) 11724 elif tag == 'tenant_name': 11725 obj.tenant_name = Reader.read_string(reader) 11726 elif tag == 'type': 11727 obj.type = Reader.read_enum(types.OpenStackNetworkProviderType, reader) 11728 elif tag == 'unmanaged': 11729 obj.unmanaged = Reader.read_boolean(reader) 11730 elif tag == 'url': 11731 obj.url = Reader.read_string(reader) 11732 elif tag == 'user_domain_name': 11733 obj.user_domain_name = Reader.read_string(reader) 11734 elif tag == 'username': 11735 obj.username = Reader.read_string(reader) 11736 elif tag == 'link': 11737 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 11738 reader.next_element() 11739 else: 11740 reader.next_element() 11741 for link in links: 11742 OpenStackNetworkProviderReader._process_link(link, obj) 11743 11744 # Discard the end tag: 11745 reader.read() 11746 11747 return obj
11749 @staticmethod 11750 def read_many(reader): 11751 # Do nothing if there aren't more tags: 11752 objs = List() 11753 if not reader.forward(): 11754 return objs 11755 11756 # Process the attributes: 11757 objs.href = reader.get_attribute('href') 11758 11759 # Discard the start tag: 11760 empty = reader.empty_element() 11761 reader.read() 11762 if empty: 11763 return objs 11764 11765 # Process the inner elements: 11766 while reader.forward(): 11767 objs.append(OpenStackNetworkProviderReader.read_one(reader)) 11768 11769 # Discard the end tag: 11770 reader.read() 11771 11772 return objs
11797class OpenStackProviderReader(Reader): 11798 11799 def __init__(self): 11800 super(OpenStackProviderReader, self).__init__() 11801 11802 @staticmethod 11803 def read_one(reader): 11804 # Do nothing if there aren't more tags: 11805 if not reader.forward(): 11806 return None 11807 11808 # Create the object: 11809 obj = types.OpenStackProvider() 11810 11811 # Process the attributes: 11812 obj.href = reader.get_attribute('href') 11813 value = reader.get_attribute('id') 11814 if value is not None: 11815 obj.id = value 11816 11817 # Discard the start tag: 11818 empty = reader.empty_element() 11819 reader.read() 11820 if empty: 11821 return obj 11822 11823 # Process the inner elements: 11824 links = [] 11825 while reader.forward(): 11826 tag = reader.node_name() 11827 if tag == 'authentication_url': 11828 obj.authentication_url = Reader.read_string(reader) 11829 elif tag == 'comment': 11830 obj.comment = Reader.read_string(reader) 11831 elif tag == 'description': 11832 obj.description = Reader.read_string(reader) 11833 elif tag == 'name': 11834 obj.name = Reader.read_string(reader) 11835 elif tag == 'password': 11836 obj.password = Reader.read_string(reader) 11837 elif tag == 'properties': 11838 obj.properties = PropertyReader.read_many(reader) 11839 elif tag == 'requires_authentication': 11840 obj.requires_authentication = Reader.read_boolean(reader) 11841 elif tag == 'tenant_name': 11842 obj.tenant_name = Reader.read_string(reader) 11843 elif tag == 'url': 11844 obj.url = Reader.read_string(reader) 11845 elif tag == 'username': 11846 obj.username = Reader.read_string(reader) 11847 else: 11848 reader.next_element() 11849 for link in links: 11850 OpenStackProviderReader._process_link(link, obj) 11851 11852 # Discard the end tag: 11853 reader.read() 11854 11855 return obj 11856 11857 @staticmethod 11858 def read_many(reader): 11859 # Do nothing if there aren't more tags: 11860 objs = List() 11861 if not reader.forward(): 11862 return objs 11863 11864 # Process the attributes: 11865 objs.href = reader.get_attribute('href') 11866 11867 # Discard the start tag: 11868 empty = reader.empty_element() 11869 reader.read() 11870 if empty: 11871 return objs 11872 11873 # Process the inner elements: 11874 while reader.forward(): 11875 objs.append(OpenStackProviderReader.read_one(reader)) 11876 11877 # Discard the end tag: 11878 reader.read() 11879 11880 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11802 @staticmethod 11803 def read_one(reader): 11804 # Do nothing if there aren't more tags: 11805 if not reader.forward(): 11806 return None 11807 11808 # Create the object: 11809 obj = types.OpenStackProvider() 11810 11811 # Process the attributes: 11812 obj.href = reader.get_attribute('href') 11813 value = reader.get_attribute('id') 11814 if value is not None: 11815 obj.id = value 11816 11817 # Discard the start tag: 11818 empty = reader.empty_element() 11819 reader.read() 11820 if empty: 11821 return obj 11822 11823 # Process the inner elements: 11824 links = [] 11825 while reader.forward(): 11826 tag = reader.node_name() 11827 if tag == 'authentication_url': 11828 obj.authentication_url = Reader.read_string(reader) 11829 elif tag == 'comment': 11830 obj.comment = Reader.read_string(reader) 11831 elif tag == 'description': 11832 obj.description = Reader.read_string(reader) 11833 elif tag == 'name': 11834 obj.name = Reader.read_string(reader) 11835 elif tag == 'password': 11836 obj.password = Reader.read_string(reader) 11837 elif tag == 'properties': 11838 obj.properties = PropertyReader.read_many(reader) 11839 elif tag == 'requires_authentication': 11840 obj.requires_authentication = Reader.read_boolean(reader) 11841 elif tag == 'tenant_name': 11842 obj.tenant_name = Reader.read_string(reader) 11843 elif tag == 'url': 11844 obj.url = Reader.read_string(reader) 11845 elif tag == 'username': 11846 obj.username = Reader.read_string(reader) 11847 else: 11848 reader.next_element() 11849 for link in links: 11850 OpenStackProviderReader._process_link(link, obj) 11851 11852 # Discard the end tag: 11853 reader.read() 11854 11855 return obj
11857 @staticmethod 11858 def read_many(reader): 11859 # Do nothing if there aren't more tags: 11860 objs = List() 11861 if not reader.forward(): 11862 return objs 11863 11864 # Process the attributes: 11865 objs.href = reader.get_attribute('href') 11866 11867 # Discard the start tag: 11868 empty = reader.empty_element() 11869 reader.read() 11870 if empty: 11871 return objs 11872 11873 # Process the inner elements: 11874 while reader.forward(): 11875 objs.append(OpenStackProviderReader.read_one(reader)) 11876 11877 # Discard the end tag: 11878 reader.read() 11879 11880 return objs
11883class OpenStackSubnetReader(Reader): 11884 11885 def __init__(self): 11886 super(OpenStackSubnetReader, self).__init__() 11887 11888 @staticmethod 11889 def read_one(reader): 11890 # Do nothing if there aren't more tags: 11891 if not reader.forward(): 11892 return None 11893 11894 # Create the object: 11895 obj = types.OpenStackSubnet() 11896 11897 # Process the attributes: 11898 obj.href = reader.get_attribute('href') 11899 value = reader.get_attribute('id') 11900 if value is not None: 11901 obj.id = value 11902 11903 # Discard the start tag: 11904 empty = reader.empty_element() 11905 reader.read() 11906 if empty: 11907 return obj 11908 11909 # Process the inner elements: 11910 links = [] 11911 while reader.forward(): 11912 tag = reader.node_name() 11913 if tag == 'cidr': 11914 obj.cidr = Reader.read_string(reader) 11915 elif tag == 'comment': 11916 obj.comment = Reader.read_string(reader) 11917 elif tag == 'description': 11918 obj.description = Reader.read_string(reader) 11919 elif tag == 'dns_servers': 11920 obj.dns_servers = Reader.read_strings(reader) 11921 elif tag == 'gateway': 11922 obj.gateway = Reader.read_string(reader) 11923 elif tag == 'ip_version': 11924 obj.ip_version = Reader.read_string(reader) 11925 elif tag == 'name': 11926 obj.name = Reader.read_string(reader) 11927 elif tag == 'openstack_network': 11928 obj.openstack_network = OpenStackNetworkReader.read_one(reader) 11929 else: 11930 reader.next_element() 11931 for link in links: 11932 OpenStackSubnetReader._process_link(link, obj) 11933 11934 # Discard the end tag: 11935 reader.read() 11936 11937 return obj 11938 11939 @staticmethod 11940 def read_many(reader): 11941 # Do nothing if there aren't more tags: 11942 objs = List() 11943 if not reader.forward(): 11944 return objs 11945 11946 # Process the attributes: 11947 objs.href = reader.get_attribute('href') 11948 11949 # Discard the start tag: 11950 empty = reader.empty_element() 11951 reader.read() 11952 if empty: 11953 return objs 11954 11955 # Process the inner elements: 11956 while reader.forward(): 11957 objs.append(OpenStackSubnetReader.read_one(reader)) 11958 11959 # Discard the end tag: 11960 reader.read() 11961 11962 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11888 @staticmethod 11889 def read_one(reader): 11890 # Do nothing if there aren't more tags: 11891 if not reader.forward(): 11892 return None 11893 11894 # Create the object: 11895 obj = types.OpenStackSubnet() 11896 11897 # Process the attributes: 11898 obj.href = reader.get_attribute('href') 11899 value = reader.get_attribute('id') 11900 if value is not None: 11901 obj.id = value 11902 11903 # Discard the start tag: 11904 empty = reader.empty_element() 11905 reader.read() 11906 if empty: 11907 return obj 11908 11909 # Process the inner elements: 11910 links = [] 11911 while reader.forward(): 11912 tag = reader.node_name() 11913 if tag == 'cidr': 11914 obj.cidr = Reader.read_string(reader) 11915 elif tag == 'comment': 11916 obj.comment = Reader.read_string(reader) 11917 elif tag == 'description': 11918 obj.description = Reader.read_string(reader) 11919 elif tag == 'dns_servers': 11920 obj.dns_servers = Reader.read_strings(reader) 11921 elif tag == 'gateway': 11922 obj.gateway = Reader.read_string(reader) 11923 elif tag == 'ip_version': 11924 obj.ip_version = Reader.read_string(reader) 11925 elif tag == 'name': 11926 obj.name = Reader.read_string(reader) 11927 elif tag == 'openstack_network': 11928 obj.openstack_network = OpenStackNetworkReader.read_one(reader) 11929 else: 11930 reader.next_element() 11931 for link in links: 11932 OpenStackSubnetReader._process_link(link, obj) 11933 11934 # Discard the end tag: 11935 reader.read() 11936 11937 return obj
11939 @staticmethod 11940 def read_many(reader): 11941 # Do nothing if there aren't more tags: 11942 objs = List() 11943 if not reader.forward(): 11944 return objs 11945 11946 # Process the attributes: 11947 objs.href = reader.get_attribute('href') 11948 11949 # Discard the start tag: 11950 empty = reader.empty_element() 11951 reader.read() 11952 if empty: 11953 return objs 11954 11955 # Process the inner elements: 11956 while reader.forward(): 11957 objs.append(OpenStackSubnetReader.read_one(reader)) 11958 11959 # Discard the end tag: 11960 reader.read() 11961 11962 return objs
11965class OpenStackVolumeProviderReader(Reader): 11966 11967 def __init__(self): 11968 super(OpenStackVolumeProviderReader, self).__init__() 11969 11970 @staticmethod 11971 def read_one(reader): 11972 # Do nothing if there aren't more tags: 11973 if not reader.forward(): 11974 return None 11975 11976 # Create the object: 11977 obj = types.OpenStackVolumeProvider() 11978 11979 # Process the attributes: 11980 obj.href = reader.get_attribute('href') 11981 value = reader.get_attribute('id') 11982 if value is not None: 11983 obj.id = value 11984 11985 # Discard the start tag: 11986 empty = reader.empty_element() 11987 reader.read() 11988 if empty: 11989 return obj 11990 11991 # Process the inner elements: 11992 links = [] 11993 while reader.forward(): 11994 tag = reader.node_name() 11995 if tag == 'authentication_keys': 11996 obj.authentication_keys = OpenstackVolumeAuthenticationKeyReader.read_many(reader) 11997 elif tag == 'authentication_url': 11998 obj.authentication_url = Reader.read_string(reader) 11999 elif tag == 'certificates': 12000 obj.certificates = CertificateReader.read_many(reader) 12001 elif tag == 'comment': 12002 obj.comment = Reader.read_string(reader) 12003 elif tag == 'data_center': 12004 obj.data_center = DataCenterReader.read_one(reader) 12005 elif tag == 'description': 12006 obj.description = Reader.read_string(reader) 12007 elif tag == 'name': 12008 obj.name = Reader.read_string(reader) 12009 elif tag == 'password': 12010 obj.password = Reader.read_string(reader) 12011 elif tag == 'properties': 12012 obj.properties = PropertyReader.read_many(reader) 12013 elif tag == 'requires_authentication': 12014 obj.requires_authentication = Reader.read_boolean(reader) 12015 elif tag == 'tenant_name': 12016 obj.tenant_name = Reader.read_string(reader) 12017 elif tag == 'url': 12018 obj.url = Reader.read_string(reader) 12019 elif tag == 'username': 12020 obj.username = Reader.read_string(reader) 12021 elif tag == 'volume_types': 12022 obj.volume_types = OpenStackVolumeTypeReader.read_many(reader) 12023 elif tag == 'link': 12024 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 12025 reader.next_element() 12026 else: 12027 reader.next_element() 12028 for link in links: 12029 OpenStackVolumeProviderReader._process_link(link, obj) 12030 12031 # Discard the end tag: 12032 reader.read() 12033 12034 return obj 12035 12036 @staticmethod 12037 def read_many(reader): 12038 # Do nothing if there aren't more tags: 12039 objs = List() 12040 if not reader.forward(): 12041 return objs 12042 12043 # Process the attributes: 12044 objs.href = reader.get_attribute('href') 12045 12046 # Discard the start tag: 12047 empty = reader.empty_element() 12048 reader.read() 12049 if empty: 12050 return objs 12051 12052 # Process the inner elements: 12053 while reader.forward(): 12054 objs.append(OpenStackVolumeProviderReader.read_one(reader)) 12055 12056 # Discard the end tag: 12057 reader.read() 12058 12059 return objs 12060 12061 @staticmethod 12062 def _process_link(link, obj): 12063 # Process the attributes: 12064 rel = link[0] 12065 href = link[1] 12066 if href and rel: 12067 if rel == "authenticationkeys": 12068 if obj.authentication_keys is not None: 12069 obj.authentication_keys.href = href 12070 else: 12071 obj.authentication_keys = List(href) 12072 elif rel == "certificates": 12073 if obj.certificates is not None: 12074 obj.certificates.href = href 12075 else: 12076 obj.certificates = List(href) 12077 elif rel == "volumetypes": 12078 if obj.volume_types is not None: 12079 obj.volume_types.href = href 12080 else: 12081 obj.volume_types = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
11970 @staticmethod 11971 def read_one(reader): 11972 # Do nothing if there aren't more tags: 11973 if not reader.forward(): 11974 return None 11975 11976 # Create the object: 11977 obj = types.OpenStackVolumeProvider() 11978 11979 # Process the attributes: 11980 obj.href = reader.get_attribute('href') 11981 value = reader.get_attribute('id') 11982 if value is not None: 11983 obj.id = value 11984 11985 # Discard the start tag: 11986 empty = reader.empty_element() 11987 reader.read() 11988 if empty: 11989 return obj 11990 11991 # Process the inner elements: 11992 links = [] 11993 while reader.forward(): 11994 tag = reader.node_name() 11995 if tag == 'authentication_keys': 11996 obj.authentication_keys = OpenstackVolumeAuthenticationKeyReader.read_many(reader) 11997 elif tag == 'authentication_url': 11998 obj.authentication_url = Reader.read_string(reader) 11999 elif tag == 'certificates': 12000 obj.certificates = CertificateReader.read_many(reader) 12001 elif tag == 'comment': 12002 obj.comment = Reader.read_string(reader) 12003 elif tag == 'data_center': 12004 obj.data_center = DataCenterReader.read_one(reader) 12005 elif tag == 'description': 12006 obj.description = Reader.read_string(reader) 12007 elif tag == 'name': 12008 obj.name = Reader.read_string(reader) 12009 elif tag == 'password': 12010 obj.password = Reader.read_string(reader) 12011 elif tag == 'properties': 12012 obj.properties = PropertyReader.read_many(reader) 12013 elif tag == 'requires_authentication': 12014 obj.requires_authentication = Reader.read_boolean(reader) 12015 elif tag == 'tenant_name': 12016 obj.tenant_name = Reader.read_string(reader) 12017 elif tag == 'url': 12018 obj.url = Reader.read_string(reader) 12019 elif tag == 'username': 12020 obj.username = Reader.read_string(reader) 12021 elif tag == 'volume_types': 12022 obj.volume_types = OpenStackVolumeTypeReader.read_many(reader) 12023 elif tag == 'link': 12024 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 12025 reader.next_element() 12026 else: 12027 reader.next_element() 12028 for link in links: 12029 OpenStackVolumeProviderReader._process_link(link, obj) 12030 12031 # Discard the end tag: 12032 reader.read() 12033 12034 return obj
12036 @staticmethod 12037 def read_many(reader): 12038 # Do nothing if there aren't more tags: 12039 objs = List() 12040 if not reader.forward(): 12041 return objs 12042 12043 # Process the attributes: 12044 objs.href = reader.get_attribute('href') 12045 12046 # Discard the start tag: 12047 empty = reader.empty_element() 12048 reader.read() 12049 if empty: 12050 return objs 12051 12052 # Process the inner elements: 12053 while reader.forward(): 12054 objs.append(OpenStackVolumeProviderReader.read_one(reader)) 12055 12056 # Discard the end tag: 12057 reader.read() 12058 12059 return objs
12084class OpenStackVolumeTypeReader(Reader): 12085 12086 def __init__(self): 12087 super(OpenStackVolumeTypeReader, self).__init__() 12088 12089 @staticmethod 12090 def read_one(reader): 12091 # Do nothing if there aren't more tags: 12092 if not reader.forward(): 12093 return None 12094 12095 # Create the object: 12096 obj = types.OpenStackVolumeType() 12097 12098 # Process the attributes: 12099 obj.href = reader.get_attribute('href') 12100 value = reader.get_attribute('id') 12101 if value is not None: 12102 obj.id = value 12103 12104 # Discard the start tag: 12105 empty = reader.empty_element() 12106 reader.read() 12107 if empty: 12108 return obj 12109 12110 # Process the inner elements: 12111 links = [] 12112 while reader.forward(): 12113 tag = reader.node_name() 12114 if tag == 'comment': 12115 obj.comment = Reader.read_string(reader) 12116 elif tag == 'description': 12117 obj.description = Reader.read_string(reader) 12118 elif tag == 'name': 12119 obj.name = Reader.read_string(reader) 12120 elif tag == 'openstack_volume_provider': 12121 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12122 elif tag == 'properties': 12123 obj.properties = PropertyReader.read_many(reader) 12124 else: 12125 reader.next_element() 12126 for link in links: 12127 OpenStackVolumeTypeReader._process_link(link, obj) 12128 12129 # Discard the end tag: 12130 reader.read() 12131 12132 return obj 12133 12134 @staticmethod 12135 def read_many(reader): 12136 # Do nothing if there aren't more tags: 12137 objs = List() 12138 if not reader.forward(): 12139 return objs 12140 12141 # Process the attributes: 12142 objs.href = reader.get_attribute('href') 12143 12144 # Discard the start tag: 12145 empty = reader.empty_element() 12146 reader.read() 12147 if empty: 12148 return objs 12149 12150 # Process the inner elements: 12151 while reader.forward(): 12152 objs.append(OpenStackVolumeTypeReader.read_one(reader)) 12153 12154 # Discard the end tag: 12155 reader.read() 12156 12157 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12089 @staticmethod 12090 def read_one(reader): 12091 # Do nothing if there aren't more tags: 12092 if not reader.forward(): 12093 return None 12094 12095 # Create the object: 12096 obj = types.OpenStackVolumeType() 12097 12098 # Process the attributes: 12099 obj.href = reader.get_attribute('href') 12100 value = reader.get_attribute('id') 12101 if value is not None: 12102 obj.id = value 12103 12104 # Discard the start tag: 12105 empty = reader.empty_element() 12106 reader.read() 12107 if empty: 12108 return obj 12109 12110 # Process the inner elements: 12111 links = [] 12112 while reader.forward(): 12113 tag = reader.node_name() 12114 if tag == 'comment': 12115 obj.comment = Reader.read_string(reader) 12116 elif tag == 'description': 12117 obj.description = Reader.read_string(reader) 12118 elif tag == 'name': 12119 obj.name = Reader.read_string(reader) 12120 elif tag == 'openstack_volume_provider': 12121 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12122 elif tag == 'properties': 12123 obj.properties = PropertyReader.read_many(reader) 12124 else: 12125 reader.next_element() 12126 for link in links: 12127 OpenStackVolumeTypeReader._process_link(link, obj) 12128 12129 # Discard the end tag: 12130 reader.read() 12131 12132 return obj
12134 @staticmethod 12135 def read_many(reader): 12136 # Do nothing if there aren't more tags: 12137 objs = List() 12138 if not reader.forward(): 12139 return objs 12140 12141 # Process the attributes: 12142 objs.href = reader.get_attribute('href') 12143 12144 # Discard the start tag: 12145 empty = reader.empty_element() 12146 reader.read() 12147 if empty: 12148 return objs 12149 12150 # Process the inner elements: 12151 while reader.forward(): 12152 objs.append(OpenStackVolumeTypeReader.read_one(reader)) 12153 12154 # Discard the end tag: 12155 reader.read() 12156 12157 return objs
12160class OpenstackVolumeAuthenticationKeyReader(Reader): 12161 12162 def __init__(self): 12163 super(OpenstackVolumeAuthenticationKeyReader, self).__init__() 12164 12165 @staticmethod 12166 def read_one(reader): 12167 # Do nothing if there aren't more tags: 12168 if not reader.forward(): 12169 return None 12170 12171 # Create the object: 12172 obj = types.OpenstackVolumeAuthenticationKey() 12173 12174 # Process the attributes: 12175 obj.href = reader.get_attribute('href') 12176 value = reader.get_attribute('id') 12177 if value is not None: 12178 obj.id = value 12179 12180 # Discard the start tag: 12181 empty = reader.empty_element() 12182 reader.read() 12183 if empty: 12184 return obj 12185 12186 # Process the inner elements: 12187 links = [] 12188 while reader.forward(): 12189 tag = reader.node_name() 12190 if tag == 'comment': 12191 obj.comment = Reader.read_string(reader) 12192 elif tag == 'creation_date': 12193 obj.creation_date = Reader.read_date(reader) 12194 elif tag == 'description': 12195 obj.description = Reader.read_string(reader) 12196 elif tag == 'name': 12197 obj.name = Reader.read_string(reader) 12198 elif tag == 'openstack_volume_provider': 12199 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12200 elif tag == 'usage_type': 12201 obj.usage_type = Reader.read_enum(types.OpenstackVolumeAuthenticationKeyUsageType, reader) 12202 elif tag == 'uuid': 12203 obj.uuid = Reader.read_string(reader) 12204 elif tag == 'value': 12205 obj.value = Reader.read_string(reader) 12206 else: 12207 reader.next_element() 12208 for link in links: 12209 OpenstackVolumeAuthenticationKeyReader._process_link(link, obj) 12210 12211 # Discard the end tag: 12212 reader.read() 12213 12214 return obj 12215 12216 @staticmethod 12217 def read_many(reader): 12218 # Do nothing if there aren't more tags: 12219 objs = List() 12220 if not reader.forward(): 12221 return objs 12222 12223 # Process the attributes: 12224 objs.href = reader.get_attribute('href') 12225 12226 # Discard the start tag: 12227 empty = reader.empty_element() 12228 reader.read() 12229 if empty: 12230 return objs 12231 12232 # Process the inner elements: 12233 while reader.forward(): 12234 objs.append(OpenstackVolumeAuthenticationKeyReader.read_one(reader)) 12235 12236 # Discard the end tag: 12237 reader.read() 12238 12239 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12165 @staticmethod 12166 def read_one(reader): 12167 # Do nothing if there aren't more tags: 12168 if not reader.forward(): 12169 return None 12170 12171 # Create the object: 12172 obj = types.OpenstackVolumeAuthenticationKey() 12173 12174 # Process the attributes: 12175 obj.href = reader.get_attribute('href') 12176 value = reader.get_attribute('id') 12177 if value is not None: 12178 obj.id = value 12179 12180 # Discard the start tag: 12181 empty = reader.empty_element() 12182 reader.read() 12183 if empty: 12184 return obj 12185 12186 # Process the inner elements: 12187 links = [] 12188 while reader.forward(): 12189 tag = reader.node_name() 12190 if tag == 'comment': 12191 obj.comment = Reader.read_string(reader) 12192 elif tag == 'creation_date': 12193 obj.creation_date = Reader.read_date(reader) 12194 elif tag == 'description': 12195 obj.description = Reader.read_string(reader) 12196 elif tag == 'name': 12197 obj.name = Reader.read_string(reader) 12198 elif tag == 'openstack_volume_provider': 12199 obj.openstack_volume_provider = OpenStackVolumeProviderReader.read_one(reader) 12200 elif tag == 'usage_type': 12201 obj.usage_type = Reader.read_enum(types.OpenstackVolumeAuthenticationKeyUsageType, reader) 12202 elif tag == 'uuid': 12203 obj.uuid = Reader.read_string(reader) 12204 elif tag == 'value': 12205 obj.value = Reader.read_string(reader) 12206 else: 12207 reader.next_element() 12208 for link in links: 12209 OpenstackVolumeAuthenticationKeyReader._process_link(link, obj) 12210 12211 # Discard the end tag: 12212 reader.read() 12213 12214 return obj
12216 @staticmethod 12217 def read_many(reader): 12218 # Do nothing if there aren't more tags: 12219 objs = List() 12220 if not reader.forward(): 12221 return objs 12222 12223 # Process the attributes: 12224 objs.href = reader.get_attribute('href') 12225 12226 # Discard the start tag: 12227 empty = reader.empty_element() 12228 reader.read() 12229 if empty: 12230 return objs 12231 12232 # Process the inner elements: 12233 while reader.forward(): 12234 objs.append(OpenstackVolumeAuthenticationKeyReader.read_one(reader)) 12235 12236 # Discard the end tag: 12237 reader.read() 12238 12239 return objs
12242class OperatingSystemReader(Reader): 12243 12244 def __init__(self): 12245 super(OperatingSystemReader, self).__init__() 12246 12247 @staticmethod 12248 def read_one(reader): 12249 # Do nothing if there aren't more tags: 12250 if not reader.forward(): 12251 return None 12252 12253 # Create the object: 12254 obj = types.OperatingSystem() 12255 12256 # Process the attributes: 12257 obj.href = reader.get_attribute('href') 12258 12259 # Discard the start tag: 12260 empty = reader.empty_element() 12261 reader.read() 12262 if empty: 12263 return obj 12264 12265 # Process the inner elements: 12266 links = [] 12267 while reader.forward(): 12268 tag = reader.node_name() 12269 if tag == 'boot': 12270 obj.boot = BootReader.read_one(reader) 12271 elif tag == 'cmdline': 12272 obj.cmdline = Reader.read_string(reader) 12273 elif tag == 'custom_kernel_cmdline': 12274 obj.custom_kernel_cmdline = Reader.read_string(reader) 12275 elif tag == 'initrd': 12276 obj.initrd = Reader.read_string(reader) 12277 elif tag == 'kernel': 12278 obj.kernel = Reader.read_string(reader) 12279 elif tag == 'reported_kernel_cmdline': 12280 obj.reported_kernel_cmdline = Reader.read_string(reader) 12281 elif tag == 'type': 12282 obj.type = Reader.read_string(reader) 12283 elif tag == 'version': 12284 obj.version = VersionReader.read_one(reader) 12285 else: 12286 reader.next_element() 12287 for link in links: 12288 OperatingSystemReader._process_link(link, obj) 12289 12290 # Discard the end tag: 12291 reader.read() 12292 12293 return obj 12294 12295 @staticmethod 12296 def read_many(reader): 12297 # Do nothing if there aren't more tags: 12298 objs = List() 12299 if not reader.forward(): 12300 return objs 12301 12302 # Process the attributes: 12303 objs.href = reader.get_attribute('href') 12304 12305 # Discard the start tag: 12306 empty = reader.empty_element() 12307 reader.read() 12308 if empty: 12309 return objs 12310 12311 # Process the inner elements: 12312 while reader.forward(): 12313 objs.append(OperatingSystemReader.read_one(reader)) 12314 12315 # Discard the end tag: 12316 reader.read() 12317 12318 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12247 @staticmethod 12248 def read_one(reader): 12249 # Do nothing if there aren't more tags: 12250 if not reader.forward(): 12251 return None 12252 12253 # Create the object: 12254 obj = types.OperatingSystem() 12255 12256 # Process the attributes: 12257 obj.href = reader.get_attribute('href') 12258 12259 # Discard the start tag: 12260 empty = reader.empty_element() 12261 reader.read() 12262 if empty: 12263 return obj 12264 12265 # Process the inner elements: 12266 links = [] 12267 while reader.forward(): 12268 tag = reader.node_name() 12269 if tag == 'boot': 12270 obj.boot = BootReader.read_one(reader) 12271 elif tag == 'cmdline': 12272 obj.cmdline = Reader.read_string(reader) 12273 elif tag == 'custom_kernel_cmdline': 12274 obj.custom_kernel_cmdline = Reader.read_string(reader) 12275 elif tag == 'initrd': 12276 obj.initrd = Reader.read_string(reader) 12277 elif tag == 'kernel': 12278 obj.kernel = Reader.read_string(reader) 12279 elif tag == 'reported_kernel_cmdline': 12280 obj.reported_kernel_cmdline = Reader.read_string(reader) 12281 elif tag == 'type': 12282 obj.type = Reader.read_string(reader) 12283 elif tag == 'version': 12284 obj.version = VersionReader.read_one(reader) 12285 else: 12286 reader.next_element() 12287 for link in links: 12288 OperatingSystemReader._process_link(link, obj) 12289 12290 # Discard the end tag: 12291 reader.read() 12292 12293 return obj
12295 @staticmethod 12296 def read_many(reader): 12297 # Do nothing if there aren't more tags: 12298 objs = List() 12299 if not reader.forward(): 12300 return objs 12301 12302 # Process the attributes: 12303 objs.href = reader.get_attribute('href') 12304 12305 # Discard the start tag: 12306 empty = reader.empty_element() 12307 reader.read() 12308 if empty: 12309 return objs 12310 12311 # Process the inner elements: 12312 while reader.forward(): 12313 objs.append(OperatingSystemReader.read_one(reader)) 12314 12315 # Discard the end tag: 12316 reader.read() 12317 12318 return objs
12321class OperatingSystemInfoReader(Reader): 12322 12323 def __init__(self): 12324 super(OperatingSystemInfoReader, self).__init__() 12325 12326 @staticmethod 12327 def read_one(reader): 12328 # Do nothing if there aren't more tags: 12329 if not reader.forward(): 12330 return None 12331 12332 # Create the object: 12333 obj = types.OperatingSystemInfo() 12334 12335 # Process the attributes: 12336 obj.href = reader.get_attribute('href') 12337 value = reader.get_attribute('id') 12338 if value is not None: 12339 obj.id = value 12340 12341 # Discard the start tag: 12342 empty = reader.empty_element() 12343 reader.read() 12344 if empty: 12345 return obj 12346 12347 # Process the inner elements: 12348 links = [] 12349 while reader.forward(): 12350 tag = reader.node_name() 12351 if tag == 'architecture': 12352 obj.architecture = Reader.read_enum(types.Architecture, reader) 12353 elif tag == 'comment': 12354 obj.comment = Reader.read_string(reader) 12355 elif tag == 'description': 12356 obj.description = Reader.read_string(reader) 12357 elif tag == 'large_icon': 12358 obj.large_icon = IconReader.read_one(reader) 12359 elif tag == 'name': 12360 obj.name = Reader.read_string(reader) 12361 elif tag == 'small_icon': 12362 obj.small_icon = IconReader.read_one(reader) 12363 else: 12364 reader.next_element() 12365 for link in links: 12366 OperatingSystemInfoReader._process_link(link, obj) 12367 12368 # Discard the end tag: 12369 reader.read() 12370 12371 return obj 12372 12373 @staticmethod 12374 def read_many(reader): 12375 # Do nothing if there aren't more tags: 12376 objs = List() 12377 if not reader.forward(): 12378 return objs 12379 12380 # Process the attributes: 12381 objs.href = reader.get_attribute('href') 12382 12383 # Discard the start tag: 12384 empty = reader.empty_element() 12385 reader.read() 12386 if empty: 12387 return objs 12388 12389 # Process the inner elements: 12390 while reader.forward(): 12391 objs.append(OperatingSystemInfoReader.read_one(reader)) 12392 12393 # Discard the end tag: 12394 reader.read() 12395 12396 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12326 @staticmethod 12327 def read_one(reader): 12328 # Do nothing if there aren't more tags: 12329 if not reader.forward(): 12330 return None 12331 12332 # Create the object: 12333 obj = types.OperatingSystemInfo() 12334 12335 # Process the attributes: 12336 obj.href = reader.get_attribute('href') 12337 value = reader.get_attribute('id') 12338 if value is not None: 12339 obj.id = value 12340 12341 # Discard the start tag: 12342 empty = reader.empty_element() 12343 reader.read() 12344 if empty: 12345 return obj 12346 12347 # Process the inner elements: 12348 links = [] 12349 while reader.forward(): 12350 tag = reader.node_name() 12351 if tag == 'architecture': 12352 obj.architecture = Reader.read_enum(types.Architecture, reader) 12353 elif tag == 'comment': 12354 obj.comment = Reader.read_string(reader) 12355 elif tag == 'description': 12356 obj.description = Reader.read_string(reader) 12357 elif tag == 'large_icon': 12358 obj.large_icon = IconReader.read_one(reader) 12359 elif tag == 'name': 12360 obj.name = Reader.read_string(reader) 12361 elif tag == 'small_icon': 12362 obj.small_icon = IconReader.read_one(reader) 12363 else: 12364 reader.next_element() 12365 for link in links: 12366 OperatingSystemInfoReader._process_link(link, obj) 12367 12368 # Discard the end tag: 12369 reader.read() 12370 12371 return obj
12373 @staticmethod 12374 def read_many(reader): 12375 # Do nothing if there aren't more tags: 12376 objs = List() 12377 if not reader.forward(): 12378 return objs 12379 12380 # Process the attributes: 12381 objs.href = reader.get_attribute('href') 12382 12383 # Discard the start tag: 12384 empty = reader.empty_element() 12385 reader.read() 12386 if empty: 12387 return objs 12388 12389 # Process the inner elements: 12390 while reader.forward(): 12391 objs.append(OperatingSystemInfoReader.read_one(reader)) 12392 12393 # Discard the end tag: 12394 reader.read() 12395 12396 return objs
12399class OptionReader(Reader): 12400 12401 def __init__(self): 12402 super(OptionReader, self).__init__() 12403 12404 @staticmethod 12405 def read_one(reader): 12406 # Do nothing if there aren't more tags: 12407 if not reader.forward(): 12408 return None 12409 12410 # Create the object: 12411 obj = types.Option() 12412 12413 # Process the attributes: 12414 obj.href = reader.get_attribute('href') 12415 12416 # Discard the start tag: 12417 empty = reader.empty_element() 12418 reader.read() 12419 if empty: 12420 return obj 12421 12422 # Process the inner elements: 12423 links = [] 12424 while reader.forward(): 12425 tag = reader.node_name() 12426 if tag == 'name': 12427 obj.name = Reader.read_string(reader) 12428 elif tag == 'type': 12429 obj.type = Reader.read_string(reader) 12430 elif tag == 'value': 12431 obj.value = Reader.read_string(reader) 12432 else: 12433 reader.next_element() 12434 for link in links: 12435 OptionReader._process_link(link, obj) 12436 12437 # Discard the end tag: 12438 reader.read() 12439 12440 return obj 12441 12442 @staticmethod 12443 def read_many(reader): 12444 # Do nothing if there aren't more tags: 12445 objs = List() 12446 if not reader.forward(): 12447 return objs 12448 12449 # Process the attributes: 12450 objs.href = reader.get_attribute('href') 12451 12452 # Discard the start tag: 12453 empty = reader.empty_element() 12454 reader.read() 12455 if empty: 12456 return objs 12457 12458 # Process the inner elements: 12459 while reader.forward(): 12460 objs.append(OptionReader.read_one(reader)) 12461 12462 # Discard the end tag: 12463 reader.read() 12464 12465 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12404 @staticmethod 12405 def read_one(reader): 12406 # Do nothing if there aren't more tags: 12407 if not reader.forward(): 12408 return None 12409 12410 # Create the object: 12411 obj = types.Option() 12412 12413 # Process the attributes: 12414 obj.href = reader.get_attribute('href') 12415 12416 # Discard the start tag: 12417 empty = reader.empty_element() 12418 reader.read() 12419 if empty: 12420 return obj 12421 12422 # Process the inner elements: 12423 links = [] 12424 while reader.forward(): 12425 tag = reader.node_name() 12426 if tag == 'name': 12427 obj.name = Reader.read_string(reader) 12428 elif tag == 'type': 12429 obj.type = Reader.read_string(reader) 12430 elif tag == 'value': 12431 obj.value = Reader.read_string(reader) 12432 else: 12433 reader.next_element() 12434 for link in links: 12435 OptionReader._process_link(link, obj) 12436 12437 # Discard the end tag: 12438 reader.read() 12439 12440 return obj
12442 @staticmethod 12443 def read_many(reader): 12444 # Do nothing if there aren't more tags: 12445 objs = List() 12446 if not reader.forward(): 12447 return objs 12448 12449 # Process the attributes: 12450 objs.href = reader.get_attribute('href') 12451 12452 # Discard the start tag: 12453 empty = reader.empty_element() 12454 reader.read() 12455 if empty: 12456 return objs 12457 12458 # Process the inner elements: 12459 while reader.forward(): 12460 objs.append(OptionReader.read_one(reader)) 12461 12462 # Discard the end tag: 12463 reader.read() 12464 12465 return objs
12468class PackageReader(Reader): 12469 12470 def __init__(self): 12471 super(PackageReader, self).__init__() 12472 12473 @staticmethod 12474 def read_one(reader): 12475 # Do nothing if there aren't more tags: 12476 if not reader.forward(): 12477 return None 12478 12479 # Create the object: 12480 obj = types.Package() 12481 12482 # Process the attributes: 12483 obj.href = reader.get_attribute('href') 12484 12485 # Discard the start tag: 12486 empty = reader.empty_element() 12487 reader.read() 12488 if empty: 12489 return obj 12490 12491 # Process the inner elements: 12492 links = [] 12493 while reader.forward(): 12494 tag = reader.node_name() 12495 if tag == 'name': 12496 obj.name = Reader.read_string(reader) 12497 else: 12498 reader.next_element() 12499 for link in links: 12500 PackageReader._process_link(link, obj) 12501 12502 # Discard the end tag: 12503 reader.read() 12504 12505 return obj 12506 12507 @staticmethod 12508 def read_many(reader): 12509 # Do nothing if there aren't more tags: 12510 objs = List() 12511 if not reader.forward(): 12512 return objs 12513 12514 # Process the attributes: 12515 objs.href = reader.get_attribute('href') 12516 12517 # Discard the start tag: 12518 empty = reader.empty_element() 12519 reader.read() 12520 if empty: 12521 return objs 12522 12523 # Process the inner elements: 12524 while reader.forward(): 12525 objs.append(PackageReader.read_one(reader)) 12526 12527 # Discard the end tag: 12528 reader.read() 12529 12530 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12473 @staticmethod 12474 def read_one(reader): 12475 # Do nothing if there aren't more tags: 12476 if not reader.forward(): 12477 return None 12478 12479 # Create the object: 12480 obj = types.Package() 12481 12482 # Process the attributes: 12483 obj.href = reader.get_attribute('href') 12484 12485 # Discard the start tag: 12486 empty = reader.empty_element() 12487 reader.read() 12488 if empty: 12489 return obj 12490 12491 # Process the inner elements: 12492 links = [] 12493 while reader.forward(): 12494 tag = reader.node_name() 12495 if tag == 'name': 12496 obj.name = Reader.read_string(reader) 12497 else: 12498 reader.next_element() 12499 for link in links: 12500 PackageReader._process_link(link, obj) 12501 12502 # Discard the end tag: 12503 reader.read() 12504 12505 return obj
12507 @staticmethod 12508 def read_many(reader): 12509 # Do nothing if there aren't more tags: 12510 objs = List() 12511 if not reader.forward(): 12512 return objs 12513 12514 # Process the attributes: 12515 objs.href = reader.get_attribute('href') 12516 12517 # Discard the start tag: 12518 empty = reader.empty_element() 12519 reader.read() 12520 if empty: 12521 return objs 12522 12523 # Process the inner elements: 12524 while reader.forward(): 12525 objs.append(PackageReader.read_one(reader)) 12526 12527 # Discard the end tag: 12528 reader.read() 12529 12530 return objs
12533class PayloadReader(Reader): 12534 12535 def __init__(self): 12536 super(PayloadReader, self).__init__() 12537 12538 @staticmethod 12539 def read_one(reader): 12540 # Do nothing if there aren't more tags: 12541 if not reader.forward(): 12542 return None 12543 12544 # Create the object: 12545 obj = types.Payload() 12546 12547 # Process the attributes: 12548 obj.href = reader.get_attribute('href') 12549 12550 # Discard the start tag: 12551 empty = reader.empty_element() 12552 reader.read() 12553 if empty: 12554 return obj 12555 12556 # Process the inner elements: 12557 links = [] 12558 while reader.forward(): 12559 tag = reader.node_name() 12560 if tag == 'files': 12561 obj.files = FileReader.read_many(reader) 12562 elif tag == 'type': 12563 obj.type = Reader.read_enum(types.VmDeviceType, reader) 12564 elif tag == 'volume_id': 12565 obj.volume_id = Reader.read_string(reader) 12566 else: 12567 reader.next_element() 12568 for link in links: 12569 PayloadReader._process_link(link, obj) 12570 12571 # Discard the end tag: 12572 reader.read() 12573 12574 return obj 12575 12576 @staticmethod 12577 def read_many(reader): 12578 # Do nothing if there aren't more tags: 12579 objs = List() 12580 if not reader.forward(): 12581 return objs 12582 12583 # Process the attributes: 12584 objs.href = reader.get_attribute('href') 12585 12586 # Discard the start tag: 12587 empty = reader.empty_element() 12588 reader.read() 12589 if empty: 12590 return objs 12591 12592 # Process the inner elements: 12593 while reader.forward(): 12594 objs.append(PayloadReader.read_one(reader)) 12595 12596 # Discard the end tag: 12597 reader.read() 12598 12599 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12538 @staticmethod 12539 def read_one(reader): 12540 # Do nothing if there aren't more tags: 12541 if not reader.forward(): 12542 return None 12543 12544 # Create the object: 12545 obj = types.Payload() 12546 12547 # Process the attributes: 12548 obj.href = reader.get_attribute('href') 12549 12550 # Discard the start tag: 12551 empty = reader.empty_element() 12552 reader.read() 12553 if empty: 12554 return obj 12555 12556 # Process the inner elements: 12557 links = [] 12558 while reader.forward(): 12559 tag = reader.node_name() 12560 if tag == 'files': 12561 obj.files = FileReader.read_many(reader) 12562 elif tag == 'type': 12563 obj.type = Reader.read_enum(types.VmDeviceType, reader) 12564 elif tag == 'volume_id': 12565 obj.volume_id = Reader.read_string(reader) 12566 else: 12567 reader.next_element() 12568 for link in links: 12569 PayloadReader._process_link(link, obj) 12570 12571 # Discard the end tag: 12572 reader.read() 12573 12574 return obj
12576 @staticmethod 12577 def read_many(reader): 12578 # Do nothing if there aren't more tags: 12579 objs = List() 12580 if not reader.forward(): 12581 return objs 12582 12583 # Process the attributes: 12584 objs.href = reader.get_attribute('href') 12585 12586 # Discard the start tag: 12587 empty = reader.empty_element() 12588 reader.read() 12589 if empty: 12590 return objs 12591 12592 # Process the inner elements: 12593 while reader.forward(): 12594 objs.append(PayloadReader.read_one(reader)) 12595 12596 # Discard the end tag: 12597 reader.read() 12598 12599 return objs
12602class PermissionReader(Reader): 12603 12604 def __init__(self): 12605 super(PermissionReader, self).__init__() 12606 12607 @staticmethod 12608 def read_one(reader): 12609 # Do nothing if there aren't more tags: 12610 if not reader.forward(): 12611 return None 12612 12613 # Create the object: 12614 obj = types.Permission() 12615 12616 # Process the attributes: 12617 obj.href = reader.get_attribute('href') 12618 value = reader.get_attribute('id') 12619 if value is not None: 12620 obj.id = value 12621 12622 # Discard the start tag: 12623 empty = reader.empty_element() 12624 reader.read() 12625 if empty: 12626 return obj 12627 12628 # Process the inner elements: 12629 links = [] 12630 while reader.forward(): 12631 tag = reader.node_name() 12632 if tag == 'cluster': 12633 obj.cluster = ClusterReader.read_one(reader) 12634 elif tag == 'comment': 12635 obj.comment = Reader.read_string(reader) 12636 elif tag == 'data_center': 12637 obj.data_center = DataCenterReader.read_one(reader) 12638 elif tag == 'description': 12639 obj.description = Reader.read_string(reader) 12640 elif tag == 'disk': 12641 obj.disk = DiskReader.read_one(reader) 12642 elif tag == 'group': 12643 obj.group = GroupReader.read_one(reader) 12644 elif tag == 'host': 12645 obj.host = HostReader.read_one(reader) 12646 elif tag == 'name': 12647 obj.name = Reader.read_string(reader) 12648 elif tag == 'role': 12649 obj.role = RoleReader.read_one(reader) 12650 elif tag == 'storage_domain': 12651 obj.storage_domain = StorageDomainReader.read_one(reader) 12652 elif tag == 'template': 12653 obj.template = TemplateReader.read_one(reader) 12654 elif tag == 'user': 12655 obj.user = UserReader.read_one(reader) 12656 elif tag == 'vm': 12657 obj.vm = VmReader.read_one(reader) 12658 elif tag == 'vm_pool': 12659 obj.vm_pool = VmPoolReader.read_one(reader) 12660 else: 12661 reader.next_element() 12662 for link in links: 12663 PermissionReader._process_link(link, obj) 12664 12665 # Discard the end tag: 12666 reader.read() 12667 12668 return obj 12669 12670 @staticmethod 12671 def read_many(reader): 12672 # Do nothing if there aren't more tags: 12673 objs = List() 12674 if not reader.forward(): 12675 return objs 12676 12677 # Process the attributes: 12678 objs.href = reader.get_attribute('href') 12679 12680 # Discard the start tag: 12681 empty = reader.empty_element() 12682 reader.read() 12683 if empty: 12684 return objs 12685 12686 # Process the inner elements: 12687 while reader.forward(): 12688 objs.append(PermissionReader.read_one(reader)) 12689 12690 # Discard the end tag: 12691 reader.read() 12692 12693 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12607 @staticmethod 12608 def read_one(reader): 12609 # Do nothing if there aren't more tags: 12610 if not reader.forward(): 12611 return None 12612 12613 # Create the object: 12614 obj = types.Permission() 12615 12616 # Process the attributes: 12617 obj.href = reader.get_attribute('href') 12618 value = reader.get_attribute('id') 12619 if value is not None: 12620 obj.id = value 12621 12622 # Discard the start tag: 12623 empty = reader.empty_element() 12624 reader.read() 12625 if empty: 12626 return obj 12627 12628 # Process the inner elements: 12629 links = [] 12630 while reader.forward(): 12631 tag = reader.node_name() 12632 if tag == 'cluster': 12633 obj.cluster = ClusterReader.read_one(reader) 12634 elif tag == 'comment': 12635 obj.comment = Reader.read_string(reader) 12636 elif tag == 'data_center': 12637 obj.data_center = DataCenterReader.read_one(reader) 12638 elif tag == 'description': 12639 obj.description = Reader.read_string(reader) 12640 elif tag == 'disk': 12641 obj.disk = DiskReader.read_one(reader) 12642 elif tag == 'group': 12643 obj.group = GroupReader.read_one(reader) 12644 elif tag == 'host': 12645 obj.host = HostReader.read_one(reader) 12646 elif tag == 'name': 12647 obj.name = Reader.read_string(reader) 12648 elif tag == 'role': 12649 obj.role = RoleReader.read_one(reader) 12650 elif tag == 'storage_domain': 12651 obj.storage_domain = StorageDomainReader.read_one(reader) 12652 elif tag == 'template': 12653 obj.template = TemplateReader.read_one(reader) 12654 elif tag == 'user': 12655 obj.user = UserReader.read_one(reader) 12656 elif tag == 'vm': 12657 obj.vm = VmReader.read_one(reader) 12658 elif tag == 'vm_pool': 12659 obj.vm_pool = VmPoolReader.read_one(reader) 12660 else: 12661 reader.next_element() 12662 for link in links: 12663 PermissionReader._process_link(link, obj) 12664 12665 # Discard the end tag: 12666 reader.read() 12667 12668 return obj
12670 @staticmethod 12671 def read_many(reader): 12672 # Do nothing if there aren't more tags: 12673 objs = List() 12674 if not reader.forward(): 12675 return objs 12676 12677 # Process the attributes: 12678 objs.href = reader.get_attribute('href') 12679 12680 # Discard the start tag: 12681 empty = reader.empty_element() 12682 reader.read() 12683 if empty: 12684 return objs 12685 12686 # Process the inner elements: 12687 while reader.forward(): 12688 objs.append(PermissionReader.read_one(reader)) 12689 12690 # Discard the end tag: 12691 reader.read() 12692 12693 return objs
12696class PermitReader(Reader): 12697 12698 def __init__(self): 12699 super(PermitReader, self).__init__() 12700 12701 @staticmethod 12702 def read_one(reader): 12703 # Do nothing if there aren't more tags: 12704 if not reader.forward(): 12705 return None 12706 12707 # Create the object: 12708 obj = types.Permit() 12709 12710 # Process the attributes: 12711 obj.href = reader.get_attribute('href') 12712 value = reader.get_attribute('id') 12713 if value is not None: 12714 obj.id = value 12715 12716 # Discard the start tag: 12717 empty = reader.empty_element() 12718 reader.read() 12719 if empty: 12720 return obj 12721 12722 # Process the inner elements: 12723 links = [] 12724 while reader.forward(): 12725 tag = reader.node_name() 12726 if tag == 'administrative': 12727 obj.administrative = Reader.read_boolean(reader) 12728 elif tag == 'comment': 12729 obj.comment = Reader.read_string(reader) 12730 elif tag == 'description': 12731 obj.description = Reader.read_string(reader) 12732 elif tag == 'name': 12733 obj.name = Reader.read_string(reader) 12734 elif tag == 'role': 12735 obj.role = RoleReader.read_one(reader) 12736 else: 12737 reader.next_element() 12738 for link in links: 12739 PermitReader._process_link(link, obj) 12740 12741 # Discard the end tag: 12742 reader.read() 12743 12744 return obj 12745 12746 @staticmethod 12747 def read_many(reader): 12748 # Do nothing if there aren't more tags: 12749 objs = List() 12750 if not reader.forward(): 12751 return objs 12752 12753 # Process the attributes: 12754 objs.href = reader.get_attribute('href') 12755 12756 # Discard the start tag: 12757 empty = reader.empty_element() 12758 reader.read() 12759 if empty: 12760 return objs 12761 12762 # Process the inner elements: 12763 while reader.forward(): 12764 objs.append(PermitReader.read_one(reader)) 12765 12766 # Discard the end tag: 12767 reader.read() 12768 12769 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12701 @staticmethod 12702 def read_one(reader): 12703 # Do nothing if there aren't more tags: 12704 if not reader.forward(): 12705 return None 12706 12707 # Create the object: 12708 obj = types.Permit() 12709 12710 # Process the attributes: 12711 obj.href = reader.get_attribute('href') 12712 value = reader.get_attribute('id') 12713 if value is not None: 12714 obj.id = value 12715 12716 # Discard the start tag: 12717 empty = reader.empty_element() 12718 reader.read() 12719 if empty: 12720 return obj 12721 12722 # Process the inner elements: 12723 links = [] 12724 while reader.forward(): 12725 tag = reader.node_name() 12726 if tag == 'administrative': 12727 obj.administrative = Reader.read_boolean(reader) 12728 elif tag == 'comment': 12729 obj.comment = Reader.read_string(reader) 12730 elif tag == 'description': 12731 obj.description = Reader.read_string(reader) 12732 elif tag == 'name': 12733 obj.name = Reader.read_string(reader) 12734 elif tag == 'role': 12735 obj.role = RoleReader.read_one(reader) 12736 else: 12737 reader.next_element() 12738 for link in links: 12739 PermitReader._process_link(link, obj) 12740 12741 # Discard the end tag: 12742 reader.read() 12743 12744 return obj
12746 @staticmethod 12747 def read_many(reader): 12748 # Do nothing if there aren't more tags: 12749 objs = List() 12750 if not reader.forward(): 12751 return objs 12752 12753 # Process the attributes: 12754 objs.href = reader.get_attribute('href') 12755 12756 # Discard the start tag: 12757 empty = reader.empty_element() 12758 reader.read() 12759 if empty: 12760 return objs 12761 12762 # Process the inner elements: 12763 while reader.forward(): 12764 objs.append(PermitReader.read_one(reader)) 12765 12766 # Discard the end tag: 12767 reader.read() 12768 12769 return objs
12772class PmProxyReader(Reader): 12773 12774 def __init__(self): 12775 super(PmProxyReader, self).__init__() 12776 12777 @staticmethod 12778 def read_one(reader): 12779 # Do nothing if there aren't more tags: 12780 if not reader.forward(): 12781 return None 12782 12783 # Create the object: 12784 obj = types.PmProxy() 12785 12786 # Process the attributes: 12787 obj.href = reader.get_attribute('href') 12788 12789 # Discard the start tag: 12790 empty = reader.empty_element() 12791 reader.read() 12792 if empty: 12793 return obj 12794 12795 # Process the inner elements: 12796 links = [] 12797 while reader.forward(): 12798 tag = reader.node_name() 12799 if tag == 'type': 12800 obj.type = Reader.read_enum(types.PmProxyType, reader) 12801 else: 12802 reader.next_element() 12803 for link in links: 12804 PmProxyReader._process_link(link, obj) 12805 12806 # Discard the end tag: 12807 reader.read() 12808 12809 return obj 12810 12811 @staticmethod 12812 def read_many(reader): 12813 # Do nothing if there aren't more tags: 12814 objs = List() 12815 if not reader.forward(): 12816 return objs 12817 12818 # Process the attributes: 12819 objs.href = reader.get_attribute('href') 12820 12821 # Discard the start tag: 12822 empty = reader.empty_element() 12823 reader.read() 12824 if empty: 12825 return objs 12826 12827 # Process the inner elements: 12828 while reader.forward(): 12829 objs.append(PmProxyReader.read_one(reader)) 12830 12831 # Discard the end tag: 12832 reader.read() 12833 12834 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12777 @staticmethod 12778 def read_one(reader): 12779 # Do nothing if there aren't more tags: 12780 if not reader.forward(): 12781 return None 12782 12783 # Create the object: 12784 obj = types.PmProxy() 12785 12786 # Process the attributes: 12787 obj.href = reader.get_attribute('href') 12788 12789 # Discard the start tag: 12790 empty = reader.empty_element() 12791 reader.read() 12792 if empty: 12793 return obj 12794 12795 # Process the inner elements: 12796 links = [] 12797 while reader.forward(): 12798 tag = reader.node_name() 12799 if tag == 'type': 12800 obj.type = Reader.read_enum(types.PmProxyType, reader) 12801 else: 12802 reader.next_element() 12803 for link in links: 12804 PmProxyReader._process_link(link, obj) 12805 12806 # Discard the end tag: 12807 reader.read() 12808 12809 return obj
12811 @staticmethod 12812 def read_many(reader): 12813 # Do nothing if there aren't more tags: 12814 objs = List() 12815 if not reader.forward(): 12816 return objs 12817 12818 # Process the attributes: 12819 objs.href = reader.get_attribute('href') 12820 12821 # Discard the start tag: 12822 empty = reader.empty_element() 12823 reader.read() 12824 if empty: 12825 return objs 12826 12827 # Process the inner elements: 12828 while reader.forward(): 12829 objs.append(PmProxyReader.read_one(reader)) 12830 12831 # Discard the end tag: 12832 reader.read() 12833 12834 return objs
12837class PortMirroringReader(Reader): 12838 12839 def __init__(self): 12840 super(PortMirroringReader, self).__init__() 12841 12842 @staticmethod 12843 def read_one(reader): 12844 # Do nothing if there aren't more tags: 12845 if not reader.forward(): 12846 return None 12847 12848 # Create the object: 12849 obj = types.PortMirroring() 12850 12851 # Process the attributes: 12852 obj.href = reader.get_attribute('href') 12853 12854 # Discard the start tag: 12855 empty = reader.empty_element() 12856 reader.read() 12857 if empty: 12858 return obj 12859 12860 # Process the inner elements: 12861 reader.next_element() 12862 12863 # Discard the end tag: 12864 reader.read() 12865 12866 return obj 12867 12868 @staticmethod 12869 def read_many(reader): 12870 # Do nothing if there aren't more tags: 12871 objs = List() 12872 if not reader.forward(): 12873 return objs 12874 12875 # Process the attributes: 12876 objs.href = reader.get_attribute('href') 12877 12878 # Discard the start tag: 12879 empty = reader.empty_element() 12880 reader.read() 12881 if empty: 12882 return objs 12883 12884 # Process the inner elements: 12885 while reader.forward(): 12886 objs.append(PortMirroringReader.read_one(reader)) 12887 12888 # Discard the end tag: 12889 reader.read() 12890 12891 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12842 @staticmethod 12843 def read_one(reader): 12844 # Do nothing if there aren't more tags: 12845 if not reader.forward(): 12846 return None 12847 12848 # Create the object: 12849 obj = types.PortMirroring() 12850 12851 # Process the attributes: 12852 obj.href = reader.get_attribute('href') 12853 12854 # Discard the start tag: 12855 empty = reader.empty_element() 12856 reader.read() 12857 if empty: 12858 return obj 12859 12860 # Process the inner elements: 12861 reader.next_element() 12862 12863 # Discard the end tag: 12864 reader.read() 12865 12866 return obj
12868 @staticmethod 12869 def read_many(reader): 12870 # Do nothing if there aren't more tags: 12871 objs = List() 12872 if not reader.forward(): 12873 return objs 12874 12875 # Process the attributes: 12876 objs.href = reader.get_attribute('href') 12877 12878 # Discard the start tag: 12879 empty = reader.empty_element() 12880 reader.read() 12881 if empty: 12882 return objs 12883 12884 # Process the inner elements: 12885 while reader.forward(): 12886 objs.append(PortMirroringReader.read_one(reader)) 12887 12888 # Discard the end tag: 12889 reader.read() 12890 12891 return objs
12894class PowerManagementReader(Reader): 12895 12896 def __init__(self): 12897 super(PowerManagementReader, self).__init__() 12898 12899 @staticmethod 12900 def read_one(reader): 12901 # Do nothing if there aren't more tags: 12902 if not reader.forward(): 12903 return None 12904 12905 # Create the object: 12906 obj = types.PowerManagement() 12907 12908 # Process the attributes: 12909 obj.href = reader.get_attribute('href') 12910 12911 # Discard the start tag: 12912 empty = reader.empty_element() 12913 reader.read() 12914 if empty: 12915 return obj 12916 12917 # Process the inner elements: 12918 links = [] 12919 while reader.forward(): 12920 tag = reader.node_name() 12921 if tag == 'address': 12922 obj.address = Reader.read_string(reader) 12923 elif tag == 'agents': 12924 obj.agents = AgentReader.read_many(reader) 12925 elif tag == 'automatic_pm_enabled': 12926 obj.automatic_pm_enabled = Reader.read_boolean(reader) 12927 elif tag == 'enabled': 12928 obj.enabled = Reader.read_boolean(reader) 12929 elif tag == 'kdump_detection': 12930 obj.kdump_detection = Reader.read_boolean(reader) 12931 elif tag == 'options': 12932 obj.options = OptionReader.read_many(reader) 12933 elif tag == 'password': 12934 obj.password = Reader.read_string(reader) 12935 elif tag == 'pm_proxies': 12936 obj.pm_proxies = PmProxyReader.read_many(reader) 12937 elif tag == 'status': 12938 obj.status = Reader.read_enum(types.PowerManagementStatus, reader) 12939 elif tag == 'type': 12940 obj.type = Reader.read_string(reader) 12941 elif tag == 'username': 12942 obj.username = Reader.read_string(reader) 12943 else: 12944 reader.next_element() 12945 for link in links: 12946 PowerManagementReader._process_link(link, obj) 12947 12948 # Discard the end tag: 12949 reader.read() 12950 12951 return obj 12952 12953 @staticmethod 12954 def read_many(reader): 12955 # Do nothing if there aren't more tags: 12956 objs = List() 12957 if not reader.forward(): 12958 return objs 12959 12960 # Process the attributes: 12961 objs.href = reader.get_attribute('href') 12962 12963 # Discard the start tag: 12964 empty = reader.empty_element() 12965 reader.read() 12966 if empty: 12967 return objs 12968 12969 # Process the inner elements: 12970 while reader.forward(): 12971 objs.append(PowerManagementReader.read_one(reader)) 12972 12973 # Discard the end tag: 12974 reader.read() 12975 12976 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12899 @staticmethod 12900 def read_one(reader): 12901 # Do nothing if there aren't more tags: 12902 if not reader.forward(): 12903 return None 12904 12905 # Create the object: 12906 obj = types.PowerManagement() 12907 12908 # Process the attributes: 12909 obj.href = reader.get_attribute('href') 12910 12911 # Discard the start tag: 12912 empty = reader.empty_element() 12913 reader.read() 12914 if empty: 12915 return obj 12916 12917 # Process the inner elements: 12918 links = [] 12919 while reader.forward(): 12920 tag = reader.node_name() 12921 if tag == 'address': 12922 obj.address = Reader.read_string(reader) 12923 elif tag == 'agents': 12924 obj.agents = AgentReader.read_many(reader) 12925 elif tag == 'automatic_pm_enabled': 12926 obj.automatic_pm_enabled = Reader.read_boolean(reader) 12927 elif tag == 'enabled': 12928 obj.enabled = Reader.read_boolean(reader) 12929 elif tag == 'kdump_detection': 12930 obj.kdump_detection = Reader.read_boolean(reader) 12931 elif tag == 'options': 12932 obj.options = OptionReader.read_many(reader) 12933 elif tag == 'password': 12934 obj.password = Reader.read_string(reader) 12935 elif tag == 'pm_proxies': 12936 obj.pm_proxies = PmProxyReader.read_many(reader) 12937 elif tag == 'status': 12938 obj.status = Reader.read_enum(types.PowerManagementStatus, reader) 12939 elif tag == 'type': 12940 obj.type = Reader.read_string(reader) 12941 elif tag == 'username': 12942 obj.username = Reader.read_string(reader) 12943 else: 12944 reader.next_element() 12945 for link in links: 12946 PowerManagementReader._process_link(link, obj) 12947 12948 # Discard the end tag: 12949 reader.read() 12950 12951 return obj
12953 @staticmethod 12954 def read_many(reader): 12955 # Do nothing if there aren't more tags: 12956 objs = List() 12957 if not reader.forward(): 12958 return objs 12959 12960 # Process the attributes: 12961 objs.href = reader.get_attribute('href') 12962 12963 # Discard the start tag: 12964 empty = reader.empty_element() 12965 reader.read() 12966 if empty: 12967 return objs 12968 12969 # Process the inner elements: 12970 while reader.forward(): 12971 objs.append(PowerManagementReader.read_one(reader)) 12972 12973 # Discard the end tag: 12974 reader.read() 12975 12976 return objs
12979class ProductReader(Reader): 12980 12981 def __init__(self): 12982 super(ProductReader, self).__init__() 12983 12984 @staticmethod 12985 def read_one(reader): 12986 # Do nothing if there aren't more tags: 12987 if not reader.forward(): 12988 return None 12989 12990 # Create the object: 12991 obj = types.Product() 12992 12993 # Process the attributes: 12994 obj.href = reader.get_attribute('href') 12995 value = reader.get_attribute('id') 12996 if value is not None: 12997 obj.id = value 12998 12999 # Discard the start tag: 13000 empty = reader.empty_element() 13001 reader.read() 13002 if empty: 13003 return obj 13004 13005 # Process the inner elements: 13006 links = [] 13007 while reader.forward(): 13008 tag = reader.node_name() 13009 if tag == 'comment': 13010 obj.comment = Reader.read_string(reader) 13011 elif tag == 'description': 13012 obj.description = Reader.read_string(reader) 13013 elif tag == 'name': 13014 obj.name = Reader.read_string(reader) 13015 else: 13016 reader.next_element() 13017 for link in links: 13018 ProductReader._process_link(link, obj) 13019 13020 # Discard the end tag: 13021 reader.read() 13022 13023 return obj 13024 13025 @staticmethod 13026 def read_many(reader): 13027 # Do nothing if there aren't more tags: 13028 objs = List() 13029 if not reader.forward(): 13030 return objs 13031 13032 # Process the attributes: 13033 objs.href = reader.get_attribute('href') 13034 13035 # Discard the start tag: 13036 empty = reader.empty_element() 13037 reader.read() 13038 if empty: 13039 return objs 13040 13041 # Process the inner elements: 13042 while reader.forward(): 13043 objs.append(ProductReader.read_one(reader)) 13044 13045 # Discard the end tag: 13046 reader.read() 13047 13048 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
12984 @staticmethod 12985 def read_one(reader): 12986 # Do nothing if there aren't more tags: 12987 if not reader.forward(): 12988 return None 12989 12990 # Create the object: 12991 obj = types.Product() 12992 12993 # Process the attributes: 12994 obj.href = reader.get_attribute('href') 12995 value = reader.get_attribute('id') 12996 if value is not None: 12997 obj.id = value 12998 12999 # Discard the start tag: 13000 empty = reader.empty_element() 13001 reader.read() 13002 if empty: 13003 return obj 13004 13005 # Process the inner elements: 13006 links = [] 13007 while reader.forward(): 13008 tag = reader.node_name() 13009 if tag == 'comment': 13010 obj.comment = Reader.read_string(reader) 13011 elif tag == 'description': 13012 obj.description = Reader.read_string(reader) 13013 elif tag == 'name': 13014 obj.name = Reader.read_string(reader) 13015 else: 13016 reader.next_element() 13017 for link in links: 13018 ProductReader._process_link(link, obj) 13019 13020 # Discard the end tag: 13021 reader.read() 13022 13023 return obj
13025 @staticmethod 13026 def read_many(reader): 13027 # Do nothing if there aren't more tags: 13028 objs = List() 13029 if not reader.forward(): 13030 return objs 13031 13032 # Process the attributes: 13033 objs.href = reader.get_attribute('href') 13034 13035 # Discard the start tag: 13036 empty = reader.empty_element() 13037 reader.read() 13038 if empty: 13039 return objs 13040 13041 # Process the inner elements: 13042 while reader.forward(): 13043 objs.append(ProductReader.read_one(reader)) 13044 13045 # Discard the end tag: 13046 reader.read() 13047 13048 return objs
13051class ProductInfoReader(Reader): 13052 13053 def __init__(self): 13054 super(ProductInfoReader, self).__init__() 13055 13056 @staticmethod 13057 def read_one(reader): 13058 # Do nothing if there aren't more tags: 13059 if not reader.forward(): 13060 return None 13061 13062 # Create the object: 13063 obj = types.ProductInfo() 13064 13065 # Process the attributes: 13066 obj.href = reader.get_attribute('href') 13067 13068 # Discard the start tag: 13069 empty = reader.empty_element() 13070 reader.read() 13071 if empty: 13072 return obj 13073 13074 # Process the inner elements: 13075 links = [] 13076 while reader.forward(): 13077 tag = reader.node_name() 13078 if tag == 'instance_id': 13079 obj.instance_id = Reader.read_string(reader) 13080 elif tag == 'name': 13081 obj.name = Reader.read_string(reader) 13082 elif tag == 'vendor': 13083 obj.vendor = Reader.read_string(reader) 13084 elif tag == 'version': 13085 obj.version = VersionReader.read_one(reader) 13086 else: 13087 reader.next_element() 13088 for link in links: 13089 ProductInfoReader._process_link(link, obj) 13090 13091 # Discard the end tag: 13092 reader.read() 13093 13094 return obj 13095 13096 @staticmethod 13097 def read_many(reader): 13098 # Do nothing if there aren't more tags: 13099 objs = List() 13100 if not reader.forward(): 13101 return objs 13102 13103 # Process the attributes: 13104 objs.href = reader.get_attribute('href') 13105 13106 # Discard the start tag: 13107 empty = reader.empty_element() 13108 reader.read() 13109 if empty: 13110 return objs 13111 13112 # Process the inner elements: 13113 while reader.forward(): 13114 objs.append(ProductInfoReader.read_one(reader)) 13115 13116 # Discard the end tag: 13117 reader.read() 13118 13119 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13056 @staticmethod 13057 def read_one(reader): 13058 # Do nothing if there aren't more tags: 13059 if not reader.forward(): 13060 return None 13061 13062 # Create the object: 13063 obj = types.ProductInfo() 13064 13065 # Process the attributes: 13066 obj.href = reader.get_attribute('href') 13067 13068 # Discard the start tag: 13069 empty = reader.empty_element() 13070 reader.read() 13071 if empty: 13072 return obj 13073 13074 # Process the inner elements: 13075 links = [] 13076 while reader.forward(): 13077 tag = reader.node_name() 13078 if tag == 'instance_id': 13079 obj.instance_id = Reader.read_string(reader) 13080 elif tag == 'name': 13081 obj.name = Reader.read_string(reader) 13082 elif tag == 'vendor': 13083 obj.vendor = Reader.read_string(reader) 13084 elif tag == 'version': 13085 obj.version = VersionReader.read_one(reader) 13086 else: 13087 reader.next_element() 13088 for link in links: 13089 ProductInfoReader._process_link(link, obj) 13090 13091 # Discard the end tag: 13092 reader.read() 13093 13094 return obj
13096 @staticmethod 13097 def read_many(reader): 13098 # Do nothing if there aren't more tags: 13099 objs = List() 13100 if not reader.forward(): 13101 return objs 13102 13103 # Process the attributes: 13104 objs.href = reader.get_attribute('href') 13105 13106 # Discard the start tag: 13107 empty = reader.empty_element() 13108 reader.read() 13109 if empty: 13110 return objs 13111 13112 # Process the inner elements: 13113 while reader.forward(): 13114 objs.append(ProductInfoReader.read_one(reader)) 13115 13116 # Discard the end tag: 13117 reader.read() 13118 13119 return objs
13122class ProfileDetailReader(Reader): 13123 13124 def __init__(self): 13125 super(ProfileDetailReader, self).__init__() 13126 13127 @staticmethod 13128 def read_one(reader): 13129 # Do nothing if there aren't more tags: 13130 if not reader.forward(): 13131 return None 13132 13133 # Create the object: 13134 obj = types.ProfileDetail() 13135 13136 # Process the attributes: 13137 obj.href = reader.get_attribute('href') 13138 13139 # Discard the start tag: 13140 empty = reader.empty_element() 13141 reader.read() 13142 if empty: 13143 return obj 13144 13145 # Process the inner elements: 13146 links = [] 13147 while reader.forward(): 13148 tag = reader.node_name() 13149 if tag == 'block_statistics': 13150 obj.block_statistics = BlockStatisticReader.read_many(reader) 13151 elif tag == 'duration': 13152 obj.duration = Reader.read_integer(reader) 13153 elif tag == 'fop_statistics': 13154 obj.fop_statistics = FopStatisticReader.read_many(reader) 13155 elif tag == 'profile_type': 13156 obj.profile_type = Reader.read_string(reader) 13157 elif tag == 'statistics': 13158 obj.statistics = StatisticReader.read_many(reader) 13159 else: 13160 reader.next_element() 13161 for link in links: 13162 ProfileDetailReader._process_link(link, obj) 13163 13164 # Discard the end tag: 13165 reader.read() 13166 13167 return obj 13168 13169 @staticmethod 13170 def read_many(reader): 13171 # Do nothing if there aren't more tags: 13172 objs = List() 13173 if not reader.forward(): 13174 return objs 13175 13176 # Process the attributes: 13177 objs.href = reader.get_attribute('href') 13178 13179 # Discard the start tag: 13180 empty = reader.empty_element() 13181 reader.read() 13182 if empty: 13183 return objs 13184 13185 # Process the inner elements: 13186 while reader.forward(): 13187 objs.append(ProfileDetailReader.read_one(reader)) 13188 13189 # Discard the end tag: 13190 reader.read() 13191 13192 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13127 @staticmethod 13128 def read_one(reader): 13129 # Do nothing if there aren't more tags: 13130 if not reader.forward(): 13131 return None 13132 13133 # Create the object: 13134 obj = types.ProfileDetail() 13135 13136 # Process the attributes: 13137 obj.href = reader.get_attribute('href') 13138 13139 # Discard the start tag: 13140 empty = reader.empty_element() 13141 reader.read() 13142 if empty: 13143 return obj 13144 13145 # Process the inner elements: 13146 links = [] 13147 while reader.forward(): 13148 tag = reader.node_name() 13149 if tag == 'block_statistics': 13150 obj.block_statistics = BlockStatisticReader.read_many(reader) 13151 elif tag == 'duration': 13152 obj.duration = Reader.read_integer(reader) 13153 elif tag == 'fop_statistics': 13154 obj.fop_statistics = FopStatisticReader.read_many(reader) 13155 elif tag == 'profile_type': 13156 obj.profile_type = Reader.read_string(reader) 13157 elif tag == 'statistics': 13158 obj.statistics = StatisticReader.read_many(reader) 13159 else: 13160 reader.next_element() 13161 for link in links: 13162 ProfileDetailReader._process_link(link, obj) 13163 13164 # Discard the end tag: 13165 reader.read() 13166 13167 return obj
13169 @staticmethod 13170 def read_many(reader): 13171 # Do nothing if there aren't more tags: 13172 objs = List() 13173 if not reader.forward(): 13174 return objs 13175 13176 # Process the attributes: 13177 objs.href = reader.get_attribute('href') 13178 13179 # Discard the start tag: 13180 empty = reader.empty_element() 13181 reader.read() 13182 if empty: 13183 return objs 13184 13185 # Process the inner elements: 13186 while reader.forward(): 13187 objs.append(ProfileDetailReader.read_one(reader)) 13188 13189 # Discard the end tag: 13190 reader.read() 13191 13192 return objs
13195class PropertyReader(Reader): 13196 13197 def __init__(self): 13198 super(PropertyReader, self).__init__() 13199 13200 @staticmethod 13201 def read_one(reader): 13202 # Do nothing if there aren't more tags: 13203 if not reader.forward(): 13204 return None 13205 13206 # Create the object: 13207 obj = types.Property() 13208 13209 # Process the attributes: 13210 obj.href = reader.get_attribute('href') 13211 13212 # Discard the start tag: 13213 empty = reader.empty_element() 13214 reader.read() 13215 if empty: 13216 return obj 13217 13218 # Process the inner elements: 13219 links = [] 13220 while reader.forward(): 13221 tag = reader.node_name() 13222 if tag == 'name': 13223 obj.name = Reader.read_string(reader) 13224 elif tag == 'value': 13225 obj.value = Reader.read_string(reader) 13226 else: 13227 reader.next_element() 13228 for link in links: 13229 PropertyReader._process_link(link, obj) 13230 13231 # Discard the end tag: 13232 reader.read() 13233 13234 return obj 13235 13236 @staticmethod 13237 def read_many(reader): 13238 # Do nothing if there aren't more tags: 13239 objs = List() 13240 if not reader.forward(): 13241 return objs 13242 13243 # Process the attributes: 13244 objs.href = reader.get_attribute('href') 13245 13246 # Discard the start tag: 13247 empty = reader.empty_element() 13248 reader.read() 13249 if empty: 13250 return objs 13251 13252 # Process the inner elements: 13253 while reader.forward(): 13254 objs.append(PropertyReader.read_one(reader)) 13255 13256 # Discard the end tag: 13257 reader.read() 13258 13259 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13200 @staticmethod 13201 def read_one(reader): 13202 # Do nothing if there aren't more tags: 13203 if not reader.forward(): 13204 return None 13205 13206 # Create the object: 13207 obj = types.Property() 13208 13209 # Process the attributes: 13210 obj.href = reader.get_attribute('href') 13211 13212 # Discard the start tag: 13213 empty = reader.empty_element() 13214 reader.read() 13215 if empty: 13216 return obj 13217 13218 # Process the inner elements: 13219 links = [] 13220 while reader.forward(): 13221 tag = reader.node_name() 13222 if tag == 'name': 13223 obj.name = Reader.read_string(reader) 13224 elif tag == 'value': 13225 obj.value = Reader.read_string(reader) 13226 else: 13227 reader.next_element() 13228 for link in links: 13229 PropertyReader._process_link(link, obj) 13230 13231 # Discard the end tag: 13232 reader.read() 13233 13234 return obj
13236 @staticmethod 13237 def read_many(reader): 13238 # Do nothing if there aren't more tags: 13239 objs = List() 13240 if not reader.forward(): 13241 return objs 13242 13243 # Process the attributes: 13244 objs.href = reader.get_attribute('href') 13245 13246 # Discard the start tag: 13247 empty = reader.empty_element() 13248 reader.read() 13249 if empty: 13250 return objs 13251 13252 # Process the inner elements: 13253 while reader.forward(): 13254 objs.append(PropertyReader.read_one(reader)) 13255 13256 # Discard the end tag: 13257 reader.read() 13258 13259 return objs
13262class ProxyTicketReader(Reader): 13263 13264 def __init__(self): 13265 super(ProxyTicketReader, self).__init__() 13266 13267 @staticmethod 13268 def read_one(reader): 13269 # Do nothing if there aren't more tags: 13270 if not reader.forward(): 13271 return None 13272 13273 # Create the object: 13274 obj = types.ProxyTicket() 13275 13276 # Process the attributes: 13277 obj.href = reader.get_attribute('href') 13278 13279 # Discard the start tag: 13280 empty = reader.empty_element() 13281 reader.read() 13282 if empty: 13283 return obj 13284 13285 # Process the inner elements: 13286 links = [] 13287 while reader.forward(): 13288 tag = reader.node_name() 13289 if tag == 'value': 13290 obj.value = Reader.read_string(reader) 13291 else: 13292 reader.next_element() 13293 for link in links: 13294 ProxyTicketReader._process_link(link, obj) 13295 13296 # Discard the end tag: 13297 reader.read() 13298 13299 return obj 13300 13301 @staticmethod 13302 def read_many(reader): 13303 # Do nothing if there aren't more tags: 13304 objs = List() 13305 if not reader.forward(): 13306 return objs 13307 13308 # Process the attributes: 13309 objs.href = reader.get_attribute('href') 13310 13311 # Discard the start tag: 13312 empty = reader.empty_element() 13313 reader.read() 13314 if empty: 13315 return objs 13316 13317 # Process the inner elements: 13318 while reader.forward(): 13319 objs.append(ProxyTicketReader.read_one(reader)) 13320 13321 # Discard the end tag: 13322 reader.read() 13323 13324 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13267 @staticmethod 13268 def read_one(reader): 13269 # Do nothing if there aren't more tags: 13270 if not reader.forward(): 13271 return None 13272 13273 # Create the object: 13274 obj = types.ProxyTicket() 13275 13276 # Process the attributes: 13277 obj.href = reader.get_attribute('href') 13278 13279 # Discard the start tag: 13280 empty = reader.empty_element() 13281 reader.read() 13282 if empty: 13283 return obj 13284 13285 # Process the inner elements: 13286 links = [] 13287 while reader.forward(): 13288 tag = reader.node_name() 13289 if tag == 'value': 13290 obj.value = Reader.read_string(reader) 13291 else: 13292 reader.next_element() 13293 for link in links: 13294 ProxyTicketReader._process_link(link, obj) 13295 13296 # Discard the end tag: 13297 reader.read() 13298 13299 return obj
13301 @staticmethod 13302 def read_many(reader): 13303 # Do nothing if there aren't more tags: 13304 objs = List() 13305 if not reader.forward(): 13306 return objs 13307 13308 # Process the attributes: 13309 objs.href = reader.get_attribute('href') 13310 13311 # Discard the start tag: 13312 empty = reader.empty_element() 13313 reader.read() 13314 if empty: 13315 return objs 13316 13317 # Process the inner elements: 13318 while reader.forward(): 13319 objs.append(ProxyTicketReader.read_one(reader)) 13320 13321 # Discard the end tag: 13322 reader.read() 13323 13324 return objs
13327class QosReader(Reader): 13328 13329 def __init__(self): 13330 super(QosReader, self).__init__() 13331 13332 @staticmethod 13333 def read_one(reader): 13334 # Do nothing if there aren't more tags: 13335 if not reader.forward(): 13336 return None 13337 13338 # Create the object: 13339 obj = types.Qos() 13340 13341 # Process the attributes: 13342 obj.href = reader.get_attribute('href') 13343 value = reader.get_attribute('id') 13344 if value is not None: 13345 obj.id = value 13346 13347 # Discard the start tag: 13348 empty = reader.empty_element() 13349 reader.read() 13350 if empty: 13351 return obj 13352 13353 # Process the inner elements: 13354 links = [] 13355 while reader.forward(): 13356 tag = reader.node_name() 13357 if tag == 'comment': 13358 obj.comment = Reader.read_string(reader) 13359 elif tag == 'cpu_limit': 13360 obj.cpu_limit = Reader.read_integer(reader) 13361 elif tag == 'data_center': 13362 obj.data_center = DataCenterReader.read_one(reader) 13363 elif tag == 'description': 13364 obj.description = Reader.read_string(reader) 13365 elif tag == 'inbound_average': 13366 obj.inbound_average = Reader.read_integer(reader) 13367 elif tag == 'inbound_burst': 13368 obj.inbound_burst = Reader.read_integer(reader) 13369 elif tag == 'inbound_peak': 13370 obj.inbound_peak = Reader.read_integer(reader) 13371 elif tag == 'max_iops': 13372 obj.max_iops = Reader.read_integer(reader) 13373 elif tag == 'max_read_iops': 13374 obj.max_read_iops = Reader.read_integer(reader) 13375 elif tag == 'max_read_throughput': 13376 obj.max_read_throughput = Reader.read_integer(reader) 13377 elif tag == 'max_throughput': 13378 obj.max_throughput = Reader.read_integer(reader) 13379 elif tag == 'max_write_iops': 13380 obj.max_write_iops = Reader.read_integer(reader) 13381 elif tag == 'max_write_throughput': 13382 obj.max_write_throughput = Reader.read_integer(reader) 13383 elif tag == 'name': 13384 obj.name = Reader.read_string(reader) 13385 elif tag == 'outbound_average': 13386 obj.outbound_average = Reader.read_integer(reader) 13387 elif tag == 'outbound_average_linkshare': 13388 obj.outbound_average_linkshare = Reader.read_integer(reader) 13389 elif tag == 'outbound_average_realtime': 13390 obj.outbound_average_realtime = Reader.read_integer(reader) 13391 elif tag == 'outbound_average_upperlimit': 13392 obj.outbound_average_upperlimit = Reader.read_integer(reader) 13393 elif tag == 'outbound_burst': 13394 obj.outbound_burst = Reader.read_integer(reader) 13395 elif tag == 'outbound_peak': 13396 obj.outbound_peak = Reader.read_integer(reader) 13397 elif tag == 'type': 13398 obj.type = Reader.read_enum(types.QosType, reader) 13399 else: 13400 reader.next_element() 13401 for link in links: 13402 QosReader._process_link(link, obj) 13403 13404 # Discard the end tag: 13405 reader.read() 13406 13407 return obj 13408 13409 @staticmethod 13410 def read_many(reader): 13411 # Do nothing if there aren't more tags: 13412 objs = List() 13413 if not reader.forward(): 13414 return objs 13415 13416 # Process the attributes: 13417 objs.href = reader.get_attribute('href') 13418 13419 # Discard the start tag: 13420 empty = reader.empty_element() 13421 reader.read() 13422 if empty: 13423 return objs 13424 13425 # Process the inner elements: 13426 while reader.forward(): 13427 objs.append(QosReader.read_one(reader)) 13428 13429 # Discard the end tag: 13430 reader.read() 13431 13432 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13332 @staticmethod 13333 def read_one(reader): 13334 # Do nothing if there aren't more tags: 13335 if not reader.forward(): 13336 return None 13337 13338 # Create the object: 13339 obj = types.Qos() 13340 13341 # Process the attributes: 13342 obj.href = reader.get_attribute('href') 13343 value = reader.get_attribute('id') 13344 if value is not None: 13345 obj.id = value 13346 13347 # Discard the start tag: 13348 empty = reader.empty_element() 13349 reader.read() 13350 if empty: 13351 return obj 13352 13353 # Process the inner elements: 13354 links = [] 13355 while reader.forward(): 13356 tag = reader.node_name() 13357 if tag == 'comment': 13358 obj.comment = Reader.read_string(reader) 13359 elif tag == 'cpu_limit': 13360 obj.cpu_limit = Reader.read_integer(reader) 13361 elif tag == 'data_center': 13362 obj.data_center = DataCenterReader.read_one(reader) 13363 elif tag == 'description': 13364 obj.description = Reader.read_string(reader) 13365 elif tag == 'inbound_average': 13366 obj.inbound_average = Reader.read_integer(reader) 13367 elif tag == 'inbound_burst': 13368 obj.inbound_burst = Reader.read_integer(reader) 13369 elif tag == 'inbound_peak': 13370 obj.inbound_peak = Reader.read_integer(reader) 13371 elif tag == 'max_iops': 13372 obj.max_iops = Reader.read_integer(reader) 13373 elif tag == 'max_read_iops': 13374 obj.max_read_iops = Reader.read_integer(reader) 13375 elif tag == 'max_read_throughput': 13376 obj.max_read_throughput = Reader.read_integer(reader) 13377 elif tag == 'max_throughput': 13378 obj.max_throughput = Reader.read_integer(reader) 13379 elif tag == 'max_write_iops': 13380 obj.max_write_iops = Reader.read_integer(reader) 13381 elif tag == 'max_write_throughput': 13382 obj.max_write_throughput = Reader.read_integer(reader) 13383 elif tag == 'name': 13384 obj.name = Reader.read_string(reader) 13385 elif tag == 'outbound_average': 13386 obj.outbound_average = Reader.read_integer(reader) 13387 elif tag == 'outbound_average_linkshare': 13388 obj.outbound_average_linkshare = Reader.read_integer(reader) 13389 elif tag == 'outbound_average_realtime': 13390 obj.outbound_average_realtime = Reader.read_integer(reader) 13391 elif tag == 'outbound_average_upperlimit': 13392 obj.outbound_average_upperlimit = Reader.read_integer(reader) 13393 elif tag == 'outbound_burst': 13394 obj.outbound_burst = Reader.read_integer(reader) 13395 elif tag == 'outbound_peak': 13396 obj.outbound_peak = Reader.read_integer(reader) 13397 elif tag == 'type': 13398 obj.type = Reader.read_enum(types.QosType, reader) 13399 else: 13400 reader.next_element() 13401 for link in links: 13402 QosReader._process_link(link, obj) 13403 13404 # Discard the end tag: 13405 reader.read() 13406 13407 return obj
13409 @staticmethod 13410 def read_many(reader): 13411 # Do nothing if there aren't more tags: 13412 objs = List() 13413 if not reader.forward(): 13414 return objs 13415 13416 # Process the attributes: 13417 objs.href = reader.get_attribute('href') 13418 13419 # Discard the start tag: 13420 empty = reader.empty_element() 13421 reader.read() 13422 if empty: 13423 return objs 13424 13425 # Process the inner elements: 13426 while reader.forward(): 13427 objs.append(QosReader.read_one(reader)) 13428 13429 # Discard the end tag: 13430 reader.read() 13431 13432 return objs
13435class QuotaReader(Reader): 13436 13437 def __init__(self): 13438 super(QuotaReader, self).__init__() 13439 13440 @staticmethod 13441 def read_one(reader): 13442 # Do nothing if there aren't more tags: 13443 if not reader.forward(): 13444 return None 13445 13446 # Create the object: 13447 obj = types.Quota() 13448 13449 # Process the attributes: 13450 obj.href = reader.get_attribute('href') 13451 value = reader.get_attribute('id') 13452 if value is not None: 13453 obj.id = value 13454 13455 # Discard the start tag: 13456 empty = reader.empty_element() 13457 reader.read() 13458 if empty: 13459 return obj 13460 13461 # Process the inner elements: 13462 links = [] 13463 while reader.forward(): 13464 tag = reader.node_name() 13465 if tag == 'cluster_hard_limit_pct': 13466 obj.cluster_hard_limit_pct = Reader.read_integer(reader) 13467 elif tag == 'cluster_soft_limit_pct': 13468 obj.cluster_soft_limit_pct = Reader.read_integer(reader) 13469 elif tag == 'comment': 13470 obj.comment = Reader.read_string(reader) 13471 elif tag == 'data_center': 13472 obj.data_center = DataCenterReader.read_one(reader) 13473 elif tag == 'description': 13474 obj.description = Reader.read_string(reader) 13475 elif tag == 'disks': 13476 obj.disks = DiskReader.read_many(reader) 13477 elif tag == 'name': 13478 obj.name = Reader.read_string(reader) 13479 elif tag == 'permissions': 13480 obj.permissions = PermissionReader.read_many(reader) 13481 elif tag == 'quota_cluster_limits': 13482 obj.quota_cluster_limits = QuotaClusterLimitReader.read_many(reader) 13483 elif tag == 'quota_storage_limits': 13484 obj.quota_storage_limits = QuotaStorageLimitReader.read_many(reader) 13485 elif tag == 'storage_hard_limit_pct': 13486 obj.storage_hard_limit_pct = Reader.read_integer(reader) 13487 elif tag == 'storage_soft_limit_pct': 13488 obj.storage_soft_limit_pct = Reader.read_integer(reader) 13489 elif tag == 'users': 13490 obj.users = UserReader.read_many(reader) 13491 elif tag == 'vms': 13492 obj.vms = VmReader.read_many(reader) 13493 elif tag == 'link': 13494 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 13495 reader.next_element() 13496 else: 13497 reader.next_element() 13498 for link in links: 13499 QuotaReader._process_link(link, obj) 13500 13501 # Discard the end tag: 13502 reader.read() 13503 13504 return obj 13505 13506 @staticmethod 13507 def read_many(reader): 13508 # Do nothing if there aren't more tags: 13509 objs = List() 13510 if not reader.forward(): 13511 return objs 13512 13513 # Process the attributes: 13514 objs.href = reader.get_attribute('href') 13515 13516 # Discard the start tag: 13517 empty = reader.empty_element() 13518 reader.read() 13519 if empty: 13520 return objs 13521 13522 # Process the inner elements: 13523 while reader.forward(): 13524 objs.append(QuotaReader.read_one(reader)) 13525 13526 # Discard the end tag: 13527 reader.read() 13528 13529 return objs 13530 13531 @staticmethod 13532 def _process_link(link, obj): 13533 # Process the attributes: 13534 rel = link[0] 13535 href = link[1] 13536 if href and rel: 13537 if rel == "permissions": 13538 if obj.permissions is not None: 13539 obj.permissions.href = href 13540 else: 13541 obj.permissions = List(href) 13542 elif rel == "quotaclusterlimits": 13543 if obj.quota_cluster_limits is not None: 13544 obj.quota_cluster_limits.href = href 13545 else: 13546 obj.quota_cluster_limits = List(href) 13547 elif rel == "quotastoragelimits": 13548 if obj.quota_storage_limits is not None: 13549 obj.quota_storage_limits.href = href 13550 else: 13551 obj.quota_storage_limits = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13440 @staticmethod 13441 def read_one(reader): 13442 # Do nothing if there aren't more tags: 13443 if not reader.forward(): 13444 return None 13445 13446 # Create the object: 13447 obj = types.Quota() 13448 13449 # Process the attributes: 13450 obj.href = reader.get_attribute('href') 13451 value = reader.get_attribute('id') 13452 if value is not None: 13453 obj.id = value 13454 13455 # Discard the start tag: 13456 empty = reader.empty_element() 13457 reader.read() 13458 if empty: 13459 return obj 13460 13461 # Process the inner elements: 13462 links = [] 13463 while reader.forward(): 13464 tag = reader.node_name() 13465 if tag == 'cluster_hard_limit_pct': 13466 obj.cluster_hard_limit_pct = Reader.read_integer(reader) 13467 elif tag == 'cluster_soft_limit_pct': 13468 obj.cluster_soft_limit_pct = Reader.read_integer(reader) 13469 elif tag == 'comment': 13470 obj.comment = Reader.read_string(reader) 13471 elif tag == 'data_center': 13472 obj.data_center = DataCenterReader.read_one(reader) 13473 elif tag == 'description': 13474 obj.description = Reader.read_string(reader) 13475 elif tag == 'disks': 13476 obj.disks = DiskReader.read_many(reader) 13477 elif tag == 'name': 13478 obj.name = Reader.read_string(reader) 13479 elif tag == 'permissions': 13480 obj.permissions = PermissionReader.read_many(reader) 13481 elif tag == 'quota_cluster_limits': 13482 obj.quota_cluster_limits = QuotaClusterLimitReader.read_many(reader) 13483 elif tag == 'quota_storage_limits': 13484 obj.quota_storage_limits = QuotaStorageLimitReader.read_many(reader) 13485 elif tag == 'storage_hard_limit_pct': 13486 obj.storage_hard_limit_pct = Reader.read_integer(reader) 13487 elif tag == 'storage_soft_limit_pct': 13488 obj.storage_soft_limit_pct = Reader.read_integer(reader) 13489 elif tag == 'users': 13490 obj.users = UserReader.read_many(reader) 13491 elif tag == 'vms': 13492 obj.vms = VmReader.read_many(reader) 13493 elif tag == 'link': 13494 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 13495 reader.next_element() 13496 else: 13497 reader.next_element() 13498 for link in links: 13499 QuotaReader._process_link(link, obj) 13500 13501 # Discard the end tag: 13502 reader.read() 13503 13504 return obj
13506 @staticmethod 13507 def read_many(reader): 13508 # Do nothing if there aren't more tags: 13509 objs = List() 13510 if not reader.forward(): 13511 return objs 13512 13513 # Process the attributes: 13514 objs.href = reader.get_attribute('href') 13515 13516 # Discard the start tag: 13517 empty = reader.empty_element() 13518 reader.read() 13519 if empty: 13520 return objs 13521 13522 # Process the inner elements: 13523 while reader.forward(): 13524 objs.append(QuotaReader.read_one(reader)) 13525 13526 # Discard the end tag: 13527 reader.read() 13528 13529 return objs
13554class QuotaClusterLimitReader(Reader): 13555 13556 def __init__(self): 13557 super(QuotaClusterLimitReader, self).__init__() 13558 13559 @staticmethod 13560 def read_one(reader): 13561 # Do nothing if there aren't more tags: 13562 if not reader.forward(): 13563 return None 13564 13565 # Create the object: 13566 obj = types.QuotaClusterLimit() 13567 13568 # Process the attributes: 13569 obj.href = reader.get_attribute('href') 13570 value = reader.get_attribute('id') 13571 if value is not None: 13572 obj.id = value 13573 13574 # Discard the start tag: 13575 empty = reader.empty_element() 13576 reader.read() 13577 if empty: 13578 return obj 13579 13580 # Process the inner elements: 13581 links = [] 13582 while reader.forward(): 13583 tag = reader.node_name() 13584 if tag == 'cluster': 13585 obj.cluster = ClusterReader.read_one(reader) 13586 elif tag == 'comment': 13587 obj.comment = Reader.read_string(reader) 13588 elif tag == 'description': 13589 obj.description = Reader.read_string(reader) 13590 elif tag == 'memory_limit': 13591 obj.memory_limit = Reader.read_decimal(reader) 13592 elif tag == 'memory_usage': 13593 obj.memory_usage = Reader.read_decimal(reader) 13594 elif tag == 'name': 13595 obj.name = Reader.read_string(reader) 13596 elif tag == 'quota': 13597 obj.quota = QuotaReader.read_one(reader) 13598 elif tag == 'vcpu_limit': 13599 obj.vcpu_limit = Reader.read_integer(reader) 13600 elif tag == 'vcpu_usage': 13601 obj.vcpu_usage = Reader.read_integer(reader) 13602 else: 13603 reader.next_element() 13604 for link in links: 13605 QuotaClusterLimitReader._process_link(link, obj) 13606 13607 # Discard the end tag: 13608 reader.read() 13609 13610 return obj 13611 13612 @staticmethod 13613 def read_many(reader): 13614 # Do nothing if there aren't more tags: 13615 objs = List() 13616 if not reader.forward(): 13617 return objs 13618 13619 # Process the attributes: 13620 objs.href = reader.get_attribute('href') 13621 13622 # Discard the start tag: 13623 empty = reader.empty_element() 13624 reader.read() 13625 if empty: 13626 return objs 13627 13628 # Process the inner elements: 13629 while reader.forward(): 13630 objs.append(QuotaClusterLimitReader.read_one(reader)) 13631 13632 # Discard the end tag: 13633 reader.read() 13634 13635 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13559 @staticmethod 13560 def read_one(reader): 13561 # Do nothing if there aren't more tags: 13562 if not reader.forward(): 13563 return None 13564 13565 # Create the object: 13566 obj = types.QuotaClusterLimit() 13567 13568 # Process the attributes: 13569 obj.href = reader.get_attribute('href') 13570 value = reader.get_attribute('id') 13571 if value is not None: 13572 obj.id = value 13573 13574 # Discard the start tag: 13575 empty = reader.empty_element() 13576 reader.read() 13577 if empty: 13578 return obj 13579 13580 # Process the inner elements: 13581 links = [] 13582 while reader.forward(): 13583 tag = reader.node_name() 13584 if tag == 'cluster': 13585 obj.cluster = ClusterReader.read_one(reader) 13586 elif tag == 'comment': 13587 obj.comment = Reader.read_string(reader) 13588 elif tag == 'description': 13589 obj.description = Reader.read_string(reader) 13590 elif tag == 'memory_limit': 13591 obj.memory_limit = Reader.read_decimal(reader) 13592 elif tag == 'memory_usage': 13593 obj.memory_usage = Reader.read_decimal(reader) 13594 elif tag == 'name': 13595 obj.name = Reader.read_string(reader) 13596 elif tag == 'quota': 13597 obj.quota = QuotaReader.read_one(reader) 13598 elif tag == 'vcpu_limit': 13599 obj.vcpu_limit = Reader.read_integer(reader) 13600 elif tag == 'vcpu_usage': 13601 obj.vcpu_usage = Reader.read_integer(reader) 13602 else: 13603 reader.next_element() 13604 for link in links: 13605 QuotaClusterLimitReader._process_link(link, obj) 13606 13607 # Discard the end tag: 13608 reader.read() 13609 13610 return obj
13612 @staticmethod 13613 def read_many(reader): 13614 # Do nothing if there aren't more tags: 13615 objs = List() 13616 if not reader.forward(): 13617 return objs 13618 13619 # Process the attributes: 13620 objs.href = reader.get_attribute('href') 13621 13622 # Discard the start tag: 13623 empty = reader.empty_element() 13624 reader.read() 13625 if empty: 13626 return objs 13627 13628 # Process the inner elements: 13629 while reader.forward(): 13630 objs.append(QuotaClusterLimitReader.read_one(reader)) 13631 13632 # Discard the end tag: 13633 reader.read() 13634 13635 return objs
13638class QuotaStorageLimitReader(Reader): 13639 13640 def __init__(self): 13641 super(QuotaStorageLimitReader, self).__init__() 13642 13643 @staticmethod 13644 def read_one(reader): 13645 # Do nothing if there aren't more tags: 13646 if not reader.forward(): 13647 return None 13648 13649 # Create the object: 13650 obj = types.QuotaStorageLimit() 13651 13652 # Process the attributes: 13653 obj.href = reader.get_attribute('href') 13654 value = reader.get_attribute('id') 13655 if value is not None: 13656 obj.id = value 13657 13658 # Discard the start tag: 13659 empty = reader.empty_element() 13660 reader.read() 13661 if empty: 13662 return obj 13663 13664 # Process the inner elements: 13665 links = [] 13666 while reader.forward(): 13667 tag = reader.node_name() 13668 if tag == 'comment': 13669 obj.comment = Reader.read_string(reader) 13670 elif tag == 'description': 13671 obj.description = Reader.read_string(reader) 13672 elif tag == 'limit': 13673 obj.limit = Reader.read_integer(reader) 13674 elif tag == 'name': 13675 obj.name = Reader.read_string(reader) 13676 elif tag == 'quota': 13677 obj.quota = QuotaReader.read_one(reader) 13678 elif tag == 'storage_domain': 13679 obj.storage_domain = StorageDomainReader.read_one(reader) 13680 elif tag == 'usage': 13681 obj.usage = Reader.read_decimal(reader) 13682 else: 13683 reader.next_element() 13684 for link in links: 13685 QuotaStorageLimitReader._process_link(link, obj) 13686 13687 # Discard the end tag: 13688 reader.read() 13689 13690 return obj 13691 13692 @staticmethod 13693 def read_many(reader): 13694 # Do nothing if there aren't more tags: 13695 objs = List() 13696 if not reader.forward(): 13697 return objs 13698 13699 # Process the attributes: 13700 objs.href = reader.get_attribute('href') 13701 13702 # Discard the start tag: 13703 empty = reader.empty_element() 13704 reader.read() 13705 if empty: 13706 return objs 13707 13708 # Process the inner elements: 13709 while reader.forward(): 13710 objs.append(QuotaStorageLimitReader.read_one(reader)) 13711 13712 # Discard the end tag: 13713 reader.read() 13714 13715 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13643 @staticmethod 13644 def read_one(reader): 13645 # Do nothing if there aren't more tags: 13646 if not reader.forward(): 13647 return None 13648 13649 # Create the object: 13650 obj = types.QuotaStorageLimit() 13651 13652 # Process the attributes: 13653 obj.href = reader.get_attribute('href') 13654 value = reader.get_attribute('id') 13655 if value is not None: 13656 obj.id = value 13657 13658 # Discard the start tag: 13659 empty = reader.empty_element() 13660 reader.read() 13661 if empty: 13662 return obj 13663 13664 # Process the inner elements: 13665 links = [] 13666 while reader.forward(): 13667 tag = reader.node_name() 13668 if tag == 'comment': 13669 obj.comment = Reader.read_string(reader) 13670 elif tag == 'description': 13671 obj.description = Reader.read_string(reader) 13672 elif tag == 'limit': 13673 obj.limit = Reader.read_integer(reader) 13674 elif tag == 'name': 13675 obj.name = Reader.read_string(reader) 13676 elif tag == 'quota': 13677 obj.quota = QuotaReader.read_one(reader) 13678 elif tag == 'storage_domain': 13679 obj.storage_domain = StorageDomainReader.read_one(reader) 13680 elif tag == 'usage': 13681 obj.usage = Reader.read_decimal(reader) 13682 else: 13683 reader.next_element() 13684 for link in links: 13685 QuotaStorageLimitReader._process_link(link, obj) 13686 13687 # Discard the end tag: 13688 reader.read() 13689 13690 return obj
13692 @staticmethod 13693 def read_many(reader): 13694 # Do nothing if there aren't more tags: 13695 objs = List() 13696 if not reader.forward(): 13697 return objs 13698 13699 # Process the attributes: 13700 objs.href = reader.get_attribute('href') 13701 13702 # Discard the start tag: 13703 empty = reader.empty_element() 13704 reader.read() 13705 if empty: 13706 return objs 13707 13708 # Process the inner elements: 13709 while reader.forward(): 13710 objs.append(QuotaStorageLimitReader.read_one(reader)) 13711 13712 # Discard the end tag: 13713 reader.read() 13714 13715 return objs
13718class RangeReader(Reader): 13719 13720 def __init__(self): 13721 super(RangeReader, self).__init__() 13722 13723 @staticmethod 13724 def read_one(reader): 13725 # Do nothing if there aren't more tags: 13726 if not reader.forward(): 13727 return None 13728 13729 # Create the object: 13730 obj = types.Range() 13731 13732 # Process the attributes: 13733 obj.href = reader.get_attribute('href') 13734 13735 # Discard the start tag: 13736 empty = reader.empty_element() 13737 reader.read() 13738 if empty: 13739 return obj 13740 13741 # Process the inner elements: 13742 links = [] 13743 while reader.forward(): 13744 tag = reader.node_name() 13745 if tag == 'from': 13746 obj.from_ = Reader.read_string(reader) 13747 elif tag == 'to': 13748 obj.to = Reader.read_string(reader) 13749 else: 13750 reader.next_element() 13751 for link in links: 13752 RangeReader._process_link(link, obj) 13753 13754 # Discard the end tag: 13755 reader.read() 13756 13757 return obj 13758 13759 @staticmethod 13760 def read_many(reader): 13761 # Do nothing if there aren't more tags: 13762 objs = List() 13763 if not reader.forward(): 13764 return objs 13765 13766 # Process the attributes: 13767 objs.href = reader.get_attribute('href') 13768 13769 # Discard the start tag: 13770 empty = reader.empty_element() 13771 reader.read() 13772 if empty: 13773 return objs 13774 13775 # Process the inner elements: 13776 while reader.forward(): 13777 objs.append(RangeReader.read_one(reader)) 13778 13779 # Discard the end tag: 13780 reader.read() 13781 13782 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13723 @staticmethod 13724 def read_one(reader): 13725 # Do nothing if there aren't more tags: 13726 if not reader.forward(): 13727 return None 13728 13729 # Create the object: 13730 obj = types.Range() 13731 13732 # Process the attributes: 13733 obj.href = reader.get_attribute('href') 13734 13735 # Discard the start tag: 13736 empty = reader.empty_element() 13737 reader.read() 13738 if empty: 13739 return obj 13740 13741 # Process the inner elements: 13742 links = [] 13743 while reader.forward(): 13744 tag = reader.node_name() 13745 if tag == 'from': 13746 obj.from_ = Reader.read_string(reader) 13747 elif tag == 'to': 13748 obj.to = Reader.read_string(reader) 13749 else: 13750 reader.next_element() 13751 for link in links: 13752 RangeReader._process_link(link, obj) 13753 13754 # Discard the end tag: 13755 reader.read() 13756 13757 return obj
13759 @staticmethod 13760 def read_many(reader): 13761 # Do nothing if there aren't more tags: 13762 objs = List() 13763 if not reader.forward(): 13764 return objs 13765 13766 # Process the attributes: 13767 objs.href = reader.get_attribute('href') 13768 13769 # Discard the start tag: 13770 empty = reader.empty_element() 13771 reader.read() 13772 if empty: 13773 return objs 13774 13775 # Process the inner elements: 13776 while reader.forward(): 13777 objs.append(RangeReader.read_one(reader)) 13778 13779 # Discard the end tag: 13780 reader.read() 13781 13782 return objs
13785class RateReader(Reader): 13786 13787 def __init__(self): 13788 super(RateReader, self).__init__() 13789 13790 @staticmethod 13791 def read_one(reader): 13792 # Do nothing if there aren't more tags: 13793 if not reader.forward(): 13794 return None 13795 13796 # Create the object: 13797 obj = types.Rate() 13798 13799 # Process the attributes: 13800 obj.href = reader.get_attribute('href') 13801 13802 # Discard the start tag: 13803 empty = reader.empty_element() 13804 reader.read() 13805 if empty: 13806 return obj 13807 13808 # Process the inner elements: 13809 links = [] 13810 while reader.forward(): 13811 tag = reader.node_name() 13812 if tag == 'bytes': 13813 obj.bytes = Reader.read_integer(reader) 13814 elif tag == 'period': 13815 obj.period = Reader.read_integer(reader) 13816 else: 13817 reader.next_element() 13818 for link in links: 13819 RateReader._process_link(link, obj) 13820 13821 # Discard the end tag: 13822 reader.read() 13823 13824 return obj 13825 13826 @staticmethod 13827 def read_many(reader): 13828 # Do nothing if there aren't more tags: 13829 objs = List() 13830 if not reader.forward(): 13831 return objs 13832 13833 # Process the attributes: 13834 objs.href = reader.get_attribute('href') 13835 13836 # Discard the start tag: 13837 empty = reader.empty_element() 13838 reader.read() 13839 if empty: 13840 return objs 13841 13842 # Process the inner elements: 13843 while reader.forward(): 13844 objs.append(RateReader.read_one(reader)) 13845 13846 # Discard the end tag: 13847 reader.read() 13848 13849 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13790 @staticmethod 13791 def read_one(reader): 13792 # Do nothing if there aren't more tags: 13793 if not reader.forward(): 13794 return None 13795 13796 # Create the object: 13797 obj = types.Rate() 13798 13799 # Process the attributes: 13800 obj.href = reader.get_attribute('href') 13801 13802 # Discard the start tag: 13803 empty = reader.empty_element() 13804 reader.read() 13805 if empty: 13806 return obj 13807 13808 # Process the inner elements: 13809 links = [] 13810 while reader.forward(): 13811 tag = reader.node_name() 13812 if tag == 'bytes': 13813 obj.bytes = Reader.read_integer(reader) 13814 elif tag == 'period': 13815 obj.period = Reader.read_integer(reader) 13816 else: 13817 reader.next_element() 13818 for link in links: 13819 RateReader._process_link(link, obj) 13820 13821 # Discard the end tag: 13822 reader.read() 13823 13824 return obj
13826 @staticmethod 13827 def read_many(reader): 13828 # Do nothing if there aren't more tags: 13829 objs = List() 13830 if not reader.forward(): 13831 return objs 13832 13833 # Process the attributes: 13834 objs.href = reader.get_attribute('href') 13835 13836 # Discard the start tag: 13837 empty = reader.empty_element() 13838 reader.read() 13839 if empty: 13840 return objs 13841 13842 # Process the inner elements: 13843 while reader.forward(): 13844 objs.append(RateReader.read_one(reader)) 13845 13846 # Discard the end tag: 13847 reader.read() 13848 13849 return objs
13852class RegistrationAffinityGroupMappingReader(Reader): 13853 13854 def __init__(self): 13855 super(RegistrationAffinityGroupMappingReader, self).__init__() 13856 13857 @staticmethod 13858 def read_one(reader): 13859 # Do nothing if there aren't more tags: 13860 if not reader.forward(): 13861 return None 13862 13863 # Create the object: 13864 obj = types.RegistrationAffinityGroupMapping() 13865 13866 # Process the attributes: 13867 obj.href = reader.get_attribute('href') 13868 13869 # Discard the start tag: 13870 empty = reader.empty_element() 13871 reader.read() 13872 if empty: 13873 return obj 13874 13875 # Process the inner elements: 13876 links = [] 13877 while reader.forward(): 13878 tag = reader.node_name() 13879 if tag == 'from': 13880 obj.from_ = AffinityGroupReader.read_one(reader) 13881 elif tag == 'to': 13882 obj.to = AffinityGroupReader.read_one(reader) 13883 else: 13884 reader.next_element() 13885 for link in links: 13886 RegistrationAffinityGroupMappingReader._process_link(link, obj) 13887 13888 # Discard the end tag: 13889 reader.read() 13890 13891 return obj 13892 13893 @staticmethod 13894 def read_many(reader): 13895 # Do nothing if there aren't more tags: 13896 objs = List() 13897 if not reader.forward(): 13898 return objs 13899 13900 # Process the attributes: 13901 objs.href = reader.get_attribute('href') 13902 13903 # Discard the start tag: 13904 empty = reader.empty_element() 13905 reader.read() 13906 if empty: 13907 return objs 13908 13909 # Process the inner elements: 13910 while reader.forward(): 13911 objs.append(RegistrationAffinityGroupMappingReader.read_one(reader)) 13912 13913 # Discard the end tag: 13914 reader.read() 13915 13916 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13857 @staticmethod 13858 def read_one(reader): 13859 # Do nothing if there aren't more tags: 13860 if not reader.forward(): 13861 return None 13862 13863 # Create the object: 13864 obj = types.RegistrationAffinityGroupMapping() 13865 13866 # Process the attributes: 13867 obj.href = reader.get_attribute('href') 13868 13869 # Discard the start tag: 13870 empty = reader.empty_element() 13871 reader.read() 13872 if empty: 13873 return obj 13874 13875 # Process the inner elements: 13876 links = [] 13877 while reader.forward(): 13878 tag = reader.node_name() 13879 if tag == 'from': 13880 obj.from_ = AffinityGroupReader.read_one(reader) 13881 elif tag == 'to': 13882 obj.to = AffinityGroupReader.read_one(reader) 13883 else: 13884 reader.next_element() 13885 for link in links: 13886 RegistrationAffinityGroupMappingReader._process_link(link, obj) 13887 13888 # Discard the end tag: 13889 reader.read() 13890 13891 return obj
13893 @staticmethod 13894 def read_many(reader): 13895 # Do nothing if there aren't more tags: 13896 objs = List() 13897 if not reader.forward(): 13898 return objs 13899 13900 # Process the attributes: 13901 objs.href = reader.get_attribute('href') 13902 13903 # Discard the start tag: 13904 empty = reader.empty_element() 13905 reader.read() 13906 if empty: 13907 return objs 13908 13909 # Process the inner elements: 13910 while reader.forward(): 13911 objs.append(RegistrationAffinityGroupMappingReader.read_one(reader)) 13912 13913 # Discard the end tag: 13914 reader.read() 13915 13916 return objs
13919class RegistrationAffinityLabelMappingReader(Reader): 13920 13921 def __init__(self): 13922 super(RegistrationAffinityLabelMappingReader, self).__init__() 13923 13924 @staticmethod 13925 def read_one(reader): 13926 # Do nothing if there aren't more tags: 13927 if not reader.forward(): 13928 return None 13929 13930 # Create the object: 13931 obj = types.RegistrationAffinityLabelMapping() 13932 13933 # Process the attributes: 13934 obj.href = reader.get_attribute('href') 13935 13936 # Discard the start tag: 13937 empty = reader.empty_element() 13938 reader.read() 13939 if empty: 13940 return obj 13941 13942 # Process the inner elements: 13943 links = [] 13944 while reader.forward(): 13945 tag = reader.node_name() 13946 if tag == 'from': 13947 obj.from_ = AffinityLabelReader.read_one(reader) 13948 elif tag == 'to': 13949 obj.to = AffinityLabelReader.read_one(reader) 13950 else: 13951 reader.next_element() 13952 for link in links: 13953 RegistrationAffinityLabelMappingReader._process_link(link, obj) 13954 13955 # Discard the end tag: 13956 reader.read() 13957 13958 return obj 13959 13960 @staticmethod 13961 def read_many(reader): 13962 # Do nothing if there aren't more tags: 13963 objs = List() 13964 if not reader.forward(): 13965 return objs 13966 13967 # Process the attributes: 13968 objs.href = reader.get_attribute('href') 13969 13970 # Discard the start tag: 13971 empty = reader.empty_element() 13972 reader.read() 13973 if empty: 13974 return objs 13975 13976 # Process the inner elements: 13977 while reader.forward(): 13978 objs.append(RegistrationAffinityLabelMappingReader.read_one(reader)) 13979 13980 # Discard the end tag: 13981 reader.read() 13982 13983 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13924 @staticmethod 13925 def read_one(reader): 13926 # Do nothing if there aren't more tags: 13927 if not reader.forward(): 13928 return None 13929 13930 # Create the object: 13931 obj = types.RegistrationAffinityLabelMapping() 13932 13933 # Process the attributes: 13934 obj.href = reader.get_attribute('href') 13935 13936 # Discard the start tag: 13937 empty = reader.empty_element() 13938 reader.read() 13939 if empty: 13940 return obj 13941 13942 # Process the inner elements: 13943 links = [] 13944 while reader.forward(): 13945 tag = reader.node_name() 13946 if tag == 'from': 13947 obj.from_ = AffinityLabelReader.read_one(reader) 13948 elif tag == 'to': 13949 obj.to = AffinityLabelReader.read_one(reader) 13950 else: 13951 reader.next_element() 13952 for link in links: 13953 RegistrationAffinityLabelMappingReader._process_link(link, obj) 13954 13955 # Discard the end tag: 13956 reader.read() 13957 13958 return obj
13960 @staticmethod 13961 def read_many(reader): 13962 # Do nothing if there aren't more tags: 13963 objs = List() 13964 if not reader.forward(): 13965 return objs 13966 13967 # Process the attributes: 13968 objs.href = reader.get_attribute('href') 13969 13970 # Discard the start tag: 13971 empty = reader.empty_element() 13972 reader.read() 13973 if empty: 13974 return objs 13975 13976 # Process the inner elements: 13977 while reader.forward(): 13978 objs.append(RegistrationAffinityLabelMappingReader.read_one(reader)) 13979 13980 # Discard the end tag: 13981 reader.read() 13982 13983 return objs
13986class RegistrationClusterMappingReader(Reader): 13987 13988 def __init__(self): 13989 super(RegistrationClusterMappingReader, self).__init__() 13990 13991 @staticmethod 13992 def read_one(reader): 13993 # Do nothing if there aren't more tags: 13994 if not reader.forward(): 13995 return None 13996 13997 # Create the object: 13998 obj = types.RegistrationClusterMapping() 13999 14000 # Process the attributes: 14001 obj.href = reader.get_attribute('href') 14002 14003 # Discard the start tag: 14004 empty = reader.empty_element() 14005 reader.read() 14006 if empty: 14007 return obj 14008 14009 # Process the inner elements: 14010 links = [] 14011 while reader.forward(): 14012 tag = reader.node_name() 14013 if tag == 'from': 14014 obj.from_ = ClusterReader.read_one(reader) 14015 elif tag == 'to': 14016 obj.to = ClusterReader.read_one(reader) 14017 else: 14018 reader.next_element() 14019 for link in links: 14020 RegistrationClusterMappingReader._process_link(link, obj) 14021 14022 # Discard the end tag: 14023 reader.read() 14024 14025 return obj 14026 14027 @staticmethod 14028 def read_many(reader): 14029 # Do nothing if there aren't more tags: 14030 objs = List() 14031 if not reader.forward(): 14032 return objs 14033 14034 # Process the attributes: 14035 objs.href = reader.get_attribute('href') 14036 14037 # Discard the start tag: 14038 empty = reader.empty_element() 14039 reader.read() 14040 if empty: 14041 return objs 14042 14043 # Process the inner elements: 14044 while reader.forward(): 14045 objs.append(RegistrationClusterMappingReader.read_one(reader)) 14046 14047 # Discard the end tag: 14048 reader.read() 14049 14050 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
13991 @staticmethod 13992 def read_one(reader): 13993 # Do nothing if there aren't more tags: 13994 if not reader.forward(): 13995 return None 13996 13997 # Create the object: 13998 obj = types.RegistrationClusterMapping() 13999 14000 # Process the attributes: 14001 obj.href = reader.get_attribute('href') 14002 14003 # Discard the start tag: 14004 empty = reader.empty_element() 14005 reader.read() 14006 if empty: 14007 return obj 14008 14009 # Process the inner elements: 14010 links = [] 14011 while reader.forward(): 14012 tag = reader.node_name() 14013 if tag == 'from': 14014 obj.from_ = ClusterReader.read_one(reader) 14015 elif tag == 'to': 14016 obj.to = ClusterReader.read_one(reader) 14017 else: 14018 reader.next_element() 14019 for link in links: 14020 RegistrationClusterMappingReader._process_link(link, obj) 14021 14022 # Discard the end tag: 14023 reader.read() 14024 14025 return obj
14027 @staticmethod 14028 def read_many(reader): 14029 # Do nothing if there aren't more tags: 14030 objs = List() 14031 if not reader.forward(): 14032 return objs 14033 14034 # Process the attributes: 14035 objs.href = reader.get_attribute('href') 14036 14037 # Discard the start tag: 14038 empty = reader.empty_element() 14039 reader.read() 14040 if empty: 14041 return objs 14042 14043 # Process the inner elements: 14044 while reader.forward(): 14045 objs.append(RegistrationClusterMappingReader.read_one(reader)) 14046 14047 # Discard the end tag: 14048 reader.read() 14049 14050 return objs
14053class RegistrationConfigurationReader(Reader): 14054 14055 def __init__(self): 14056 super(RegistrationConfigurationReader, self).__init__() 14057 14058 @staticmethod 14059 def read_one(reader): 14060 # Do nothing if there aren't more tags: 14061 if not reader.forward(): 14062 return None 14063 14064 # Create the object: 14065 obj = types.RegistrationConfiguration() 14066 14067 # Process the attributes: 14068 obj.href = reader.get_attribute('href') 14069 14070 # Discard the start tag: 14071 empty = reader.empty_element() 14072 reader.read() 14073 if empty: 14074 return obj 14075 14076 # Process the inner elements: 14077 links = [] 14078 while reader.forward(): 14079 tag = reader.node_name() 14080 if tag == 'affinity_group_mappings': 14081 obj.affinity_group_mappings = RegistrationAffinityGroupMappingReader.read_many(reader) 14082 elif tag == 'affinity_label_mappings': 14083 obj.affinity_label_mappings = RegistrationAffinityLabelMappingReader.read_many(reader) 14084 elif tag == 'cluster_mappings': 14085 obj.cluster_mappings = RegistrationClusterMappingReader.read_many(reader) 14086 elif tag == 'domain_mappings': 14087 obj.domain_mappings = RegistrationDomainMappingReader.read_many(reader) 14088 elif tag == 'lun_mappings': 14089 obj.lun_mappings = RegistrationLunMappingReader.read_many(reader) 14090 elif tag == 'role_mappings': 14091 obj.role_mappings = RegistrationRoleMappingReader.read_many(reader) 14092 elif tag == 'vnic_profile_mappings': 14093 obj.vnic_profile_mappings = RegistrationVnicProfileMappingReader.read_many(reader) 14094 else: 14095 reader.next_element() 14096 for link in links: 14097 RegistrationConfigurationReader._process_link(link, obj) 14098 14099 # Discard the end tag: 14100 reader.read() 14101 14102 return obj 14103 14104 @staticmethod 14105 def read_many(reader): 14106 # Do nothing if there aren't more tags: 14107 objs = List() 14108 if not reader.forward(): 14109 return objs 14110 14111 # Process the attributes: 14112 objs.href = reader.get_attribute('href') 14113 14114 # Discard the start tag: 14115 empty = reader.empty_element() 14116 reader.read() 14117 if empty: 14118 return objs 14119 14120 # Process the inner elements: 14121 while reader.forward(): 14122 objs.append(RegistrationConfigurationReader.read_one(reader)) 14123 14124 # Discard the end tag: 14125 reader.read() 14126 14127 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14058 @staticmethod 14059 def read_one(reader): 14060 # Do nothing if there aren't more tags: 14061 if not reader.forward(): 14062 return None 14063 14064 # Create the object: 14065 obj = types.RegistrationConfiguration() 14066 14067 # Process the attributes: 14068 obj.href = reader.get_attribute('href') 14069 14070 # Discard the start tag: 14071 empty = reader.empty_element() 14072 reader.read() 14073 if empty: 14074 return obj 14075 14076 # Process the inner elements: 14077 links = [] 14078 while reader.forward(): 14079 tag = reader.node_name() 14080 if tag == 'affinity_group_mappings': 14081 obj.affinity_group_mappings = RegistrationAffinityGroupMappingReader.read_many(reader) 14082 elif tag == 'affinity_label_mappings': 14083 obj.affinity_label_mappings = RegistrationAffinityLabelMappingReader.read_many(reader) 14084 elif tag == 'cluster_mappings': 14085 obj.cluster_mappings = RegistrationClusterMappingReader.read_many(reader) 14086 elif tag == 'domain_mappings': 14087 obj.domain_mappings = RegistrationDomainMappingReader.read_many(reader) 14088 elif tag == 'lun_mappings': 14089 obj.lun_mappings = RegistrationLunMappingReader.read_many(reader) 14090 elif tag == 'role_mappings': 14091 obj.role_mappings = RegistrationRoleMappingReader.read_many(reader) 14092 elif tag == 'vnic_profile_mappings': 14093 obj.vnic_profile_mappings = RegistrationVnicProfileMappingReader.read_many(reader) 14094 else: 14095 reader.next_element() 14096 for link in links: 14097 RegistrationConfigurationReader._process_link(link, obj) 14098 14099 # Discard the end tag: 14100 reader.read() 14101 14102 return obj
14104 @staticmethod 14105 def read_many(reader): 14106 # Do nothing if there aren't more tags: 14107 objs = List() 14108 if not reader.forward(): 14109 return objs 14110 14111 # Process the attributes: 14112 objs.href = reader.get_attribute('href') 14113 14114 # Discard the start tag: 14115 empty = reader.empty_element() 14116 reader.read() 14117 if empty: 14118 return objs 14119 14120 # Process the inner elements: 14121 while reader.forward(): 14122 objs.append(RegistrationConfigurationReader.read_one(reader)) 14123 14124 # Discard the end tag: 14125 reader.read() 14126 14127 return objs
14130class RegistrationDomainMappingReader(Reader): 14131 14132 def __init__(self): 14133 super(RegistrationDomainMappingReader, self).__init__() 14134 14135 @staticmethod 14136 def read_one(reader): 14137 # Do nothing if there aren't more tags: 14138 if not reader.forward(): 14139 return None 14140 14141 # Create the object: 14142 obj = types.RegistrationDomainMapping() 14143 14144 # Process the attributes: 14145 obj.href = reader.get_attribute('href') 14146 14147 # Discard the start tag: 14148 empty = reader.empty_element() 14149 reader.read() 14150 if empty: 14151 return obj 14152 14153 # Process the inner elements: 14154 links = [] 14155 while reader.forward(): 14156 tag = reader.node_name() 14157 if tag == 'from': 14158 obj.from_ = DomainReader.read_one(reader) 14159 elif tag == 'to': 14160 obj.to = DomainReader.read_one(reader) 14161 else: 14162 reader.next_element() 14163 for link in links: 14164 RegistrationDomainMappingReader._process_link(link, obj) 14165 14166 # Discard the end tag: 14167 reader.read() 14168 14169 return obj 14170 14171 @staticmethod 14172 def read_many(reader): 14173 # Do nothing if there aren't more tags: 14174 objs = List() 14175 if not reader.forward(): 14176 return objs 14177 14178 # Process the attributes: 14179 objs.href = reader.get_attribute('href') 14180 14181 # Discard the start tag: 14182 empty = reader.empty_element() 14183 reader.read() 14184 if empty: 14185 return objs 14186 14187 # Process the inner elements: 14188 while reader.forward(): 14189 objs.append(RegistrationDomainMappingReader.read_one(reader)) 14190 14191 # Discard the end tag: 14192 reader.read() 14193 14194 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14135 @staticmethod 14136 def read_one(reader): 14137 # Do nothing if there aren't more tags: 14138 if not reader.forward(): 14139 return None 14140 14141 # Create the object: 14142 obj = types.RegistrationDomainMapping() 14143 14144 # Process the attributes: 14145 obj.href = reader.get_attribute('href') 14146 14147 # Discard the start tag: 14148 empty = reader.empty_element() 14149 reader.read() 14150 if empty: 14151 return obj 14152 14153 # Process the inner elements: 14154 links = [] 14155 while reader.forward(): 14156 tag = reader.node_name() 14157 if tag == 'from': 14158 obj.from_ = DomainReader.read_one(reader) 14159 elif tag == 'to': 14160 obj.to = DomainReader.read_one(reader) 14161 else: 14162 reader.next_element() 14163 for link in links: 14164 RegistrationDomainMappingReader._process_link(link, obj) 14165 14166 # Discard the end tag: 14167 reader.read() 14168 14169 return obj
14171 @staticmethod 14172 def read_many(reader): 14173 # Do nothing if there aren't more tags: 14174 objs = List() 14175 if not reader.forward(): 14176 return objs 14177 14178 # Process the attributes: 14179 objs.href = reader.get_attribute('href') 14180 14181 # Discard the start tag: 14182 empty = reader.empty_element() 14183 reader.read() 14184 if empty: 14185 return objs 14186 14187 # Process the inner elements: 14188 while reader.forward(): 14189 objs.append(RegistrationDomainMappingReader.read_one(reader)) 14190 14191 # Discard the end tag: 14192 reader.read() 14193 14194 return objs
14197class RegistrationLunMappingReader(Reader): 14198 14199 def __init__(self): 14200 super(RegistrationLunMappingReader, self).__init__() 14201 14202 @staticmethod 14203 def read_one(reader): 14204 # Do nothing if there aren't more tags: 14205 if not reader.forward(): 14206 return None 14207 14208 # Create the object: 14209 obj = types.RegistrationLunMapping() 14210 14211 # Process the attributes: 14212 obj.href = reader.get_attribute('href') 14213 14214 # Discard the start tag: 14215 empty = reader.empty_element() 14216 reader.read() 14217 if empty: 14218 return obj 14219 14220 # Process the inner elements: 14221 links = [] 14222 while reader.forward(): 14223 tag = reader.node_name() 14224 if tag == 'from': 14225 obj.from_ = DiskReader.read_one(reader) 14226 elif tag == 'to': 14227 obj.to = DiskReader.read_one(reader) 14228 else: 14229 reader.next_element() 14230 for link in links: 14231 RegistrationLunMappingReader._process_link(link, obj) 14232 14233 # Discard the end tag: 14234 reader.read() 14235 14236 return obj 14237 14238 @staticmethod 14239 def read_many(reader): 14240 # Do nothing if there aren't more tags: 14241 objs = List() 14242 if not reader.forward(): 14243 return objs 14244 14245 # Process the attributes: 14246 objs.href = reader.get_attribute('href') 14247 14248 # Discard the start tag: 14249 empty = reader.empty_element() 14250 reader.read() 14251 if empty: 14252 return objs 14253 14254 # Process the inner elements: 14255 while reader.forward(): 14256 objs.append(RegistrationLunMappingReader.read_one(reader)) 14257 14258 # Discard the end tag: 14259 reader.read() 14260 14261 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14202 @staticmethod 14203 def read_one(reader): 14204 # Do nothing if there aren't more tags: 14205 if not reader.forward(): 14206 return None 14207 14208 # Create the object: 14209 obj = types.RegistrationLunMapping() 14210 14211 # Process the attributes: 14212 obj.href = reader.get_attribute('href') 14213 14214 # Discard the start tag: 14215 empty = reader.empty_element() 14216 reader.read() 14217 if empty: 14218 return obj 14219 14220 # Process the inner elements: 14221 links = [] 14222 while reader.forward(): 14223 tag = reader.node_name() 14224 if tag == 'from': 14225 obj.from_ = DiskReader.read_one(reader) 14226 elif tag == 'to': 14227 obj.to = DiskReader.read_one(reader) 14228 else: 14229 reader.next_element() 14230 for link in links: 14231 RegistrationLunMappingReader._process_link(link, obj) 14232 14233 # Discard the end tag: 14234 reader.read() 14235 14236 return obj
14238 @staticmethod 14239 def read_many(reader): 14240 # Do nothing if there aren't more tags: 14241 objs = List() 14242 if not reader.forward(): 14243 return objs 14244 14245 # Process the attributes: 14246 objs.href = reader.get_attribute('href') 14247 14248 # Discard the start tag: 14249 empty = reader.empty_element() 14250 reader.read() 14251 if empty: 14252 return objs 14253 14254 # Process the inner elements: 14255 while reader.forward(): 14256 objs.append(RegistrationLunMappingReader.read_one(reader)) 14257 14258 # Discard the end tag: 14259 reader.read() 14260 14261 return objs
14264class RegistrationRoleMappingReader(Reader): 14265 14266 def __init__(self): 14267 super(RegistrationRoleMappingReader, self).__init__() 14268 14269 @staticmethod 14270 def read_one(reader): 14271 # Do nothing if there aren't more tags: 14272 if not reader.forward(): 14273 return None 14274 14275 # Create the object: 14276 obj = types.RegistrationRoleMapping() 14277 14278 # Process the attributes: 14279 obj.href = reader.get_attribute('href') 14280 14281 # Discard the start tag: 14282 empty = reader.empty_element() 14283 reader.read() 14284 if empty: 14285 return obj 14286 14287 # Process the inner elements: 14288 links = [] 14289 while reader.forward(): 14290 tag = reader.node_name() 14291 if tag == 'from': 14292 obj.from_ = RoleReader.read_one(reader) 14293 elif tag == 'to': 14294 obj.to = RoleReader.read_one(reader) 14295 else: 14296 reader.next_element() 14297 for link in links: 14298 RegistrationRoleMappingReader._process_link(link, obj) 14299 14300 # Discard the end tag: 14301 reader.read() 14302 14303 return obj 14304 14305 @staticmethod 14306 def read_many(reader): 14307 # Do nothing if there aren't more tags: 14308 objs = List() 14309 if not reader.forward(): 14310 return objs 14311 14312 # Process the attributes: 14313 objs.href = reader.get_attribute('href') 14314 14315 # Discard the start tag: 14316 empty = reader.empty_element() 14317 reader.read() 14318 if empty: 14319 return objs 14320 14321 # Process the inner elements: 14322 while reader.forward(): 14323 objs.append(RegistrationRoleMappingReader.read_one(reader)) 14324 14325 # Discard the end tag: 14326 reader.read() 14327 14328 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14269 @staticmethod 14270 def read_one(reader): 14271 # Do nothing if there aren't more tags: 14272 if not reader.forward(): 14273 return None 14274 14275 # Create the object: 14276 obj = types.RegistrationRoleMapping() 14277 14278 # Process the attributes: 14279 obj.href = reader.get_attribute('href') 14280 14281 # Discard the start tag: 14282 empty = reader.empty_element() 14283 reader.read() 14284 if empty: 14285 return obj 14286 14287 # Process the inner elements: 14288 links = [] 14289 while reader.forward(): 14290 tag = reader.node_name() 14291 if tag == 'from': 14292 obj.from_ = RoleReader.read_one(reader) 14293 elif tag == 'to': 14294 obj.to = RoleReader.read_one(reader) 14295 else: 14296 reader.next_element() 14297 for link in links: 14298 RegistrationRoleMappingReader._process_link(link, obj) 14299 14300 # Discard the end tag: 14301 reader.read() 14302 14303 return obj
14305 @staticmethod 14306 def read_many(reader): 14307 # Do nothing if there aren't more tags: 14308 objs = List() 14309 if not reader.forward(): 14310 return objs 14311 14312 # Process the attributes: 14313 objs.href = reader.get_attribute('href') 14314 14315 # Discard the start tag: 14316 empty = reader.empty_element() 14317 reader.read() 14318 if empty: 14319 return objs 14320 14321 # Process the inner elements: 14322 while reader.forward(): 14323 objs.append(RegistrationRoleMappingReader.read_one(reader)) 14324 14325 # Discard the end tag: 14326 reader.read() 14327 14328 return objs
14331class RegistrationVnicProfileMappingReader(Reader): 14332 14333 def __init__(self): 14334 super(RegistrationVnicProfileMappingReader, self).__init__() 14335 14336 @staticmethod 14337 def read_one(reader): 14338 # Do nothing if there aren't more tags: 14339 if not reader.forward(): 14340 return None 14341 14342 # Create the object: 14343 obj = types.RegistrationVnicProfileMapping() 14344 14345 # Process the attributes: 14346 obj.href = reader.get_attribute('href') 14347 14348 # Discard the start tag: 14349 empty = reader.empty_element() 14350 reader.read() 14351 if empty: 14352 return obj 14353 14354 # Process the inner elements: 14355 links = [] 14356 while reader.forward(): 14357 tag = reader.node_name() 14358 if tag == 'from': 14359 obj.from_ = VnicProfileReader.read_one(reader) 14360 elif tag == 'to': 14361 obj.to = VnicProfileReader.read_one(reader) 14362 else: 14363 reader.next_element() 14364 for link in links: 14365 RegistrationVnicProfileMappingReader._process_link(link, obj) 14366 14367 # Discard the end tag: 14368 reader.read() 14369 14370 return obj 14371 14372 @staticmethod 14373 def read_many(reader): 14374 # Do nothing if there aren't more tags: 14375 objs = List() 14376 if not reader.forward(): 14377 return objs 14378 14379 # Process the attributes: 14380 objs.href = reader.get_attribute('href') 14381 14382 # Discard the start tag: 14383 empty = reader.empty_element() 14384 reader.read() 14385 if empty: 14386 return objs 14387 14388 # Process the inner elements: 14389 while reader.forward(): 14390 objs.append(RegistrationVnicProfileMappingReader.read_one(reader)) 14391 14392 # Discard the end tag: 14393 reader.read() 14394 14395 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14336 @staticmethod 14337 def read_one(reader): 14338 # Do nothing if there aren't more tags: 14339 if not reader.forward(): 14340 return None 14341 14342 # Create the object: 14343 obj = types.RegistrationVnicProfileMapping() 14344 14345 # Process the attributes: 14346 obj.href = reader.get_attribute('href') 14347 14348 # Discard the start tag: 14349 empty = reader.empty_element() 14350 reader.read() 14351 if empty: 14352 return obj 14353 14354 # Process the inner elements: 14355 links = [] 14356 while reader.forward(): 14357 tag = reader.node_name() 14358 if tag == 'from': 14359 obj.from_ = VnicProfileReader.read_one(reader) 14360 elif tag == 'to': 14361 obj.to = VnicProfileReader.read_one(reader) 14362 else: 14363 reader.next_element() 14364 for link in links: 14365 RegistrationVnicProfileMappingReader._process_link(link, obj) 14366 14367 # Discard the end tag: 14368 reader.read() 14369 14370 return obj
14372 @staticmethod 14373 def read_many(reader): 14374 # Do nothing if there aren't more tags: 14375 objs = List() 14376 if not reader.forward(): 14377 return objs 14378 14379 # Process the attributes: 14380 objs.href = reader.get_attribute('href') 14381 14382 # Discard the start tag: 14383 empty = reader.empty_element() 14384 reader.read() 14385 if empty: 14386 return objs 14387 14388 # Process the inner elements: 14389 while reader.forward(): 14390 objs.append(RegistrationVnicProfileMappingReader.read_one(reader)) 14391 14392 # Discard the end tag: 14393 reader.read() 14394 14395 return objs
14398class ReportedConfigurationReader(Reader): 14399 14400 def __init__(self): 14401 super(ReportedConfigurationReader, self).__init__() 14402 14403 @staticmethod 14404 def read_one(reader): 14405 # Do nothing if there aren't more tags: 14406 if not reader.forward(): 14407 return None 14408 14409 # Create the object: 14410 obj = types.ReportedConfiguration() 14411 14412 # Process the attributes: 14413 obj.href = reader.get_attribute('href') 14414 14415 # Discard the start tag: 14416 empty = reader.empty_element() 14417 reader.read() 14418 if empty: 14419 return obj 14420 14421 # Process the inner elements: 14422 links = [] 14423 while reader.forward(): 14424 tag = reader.node_name() 14425 if tag == 'actual_value': 14426 obj.actual_value = Reader.read_string(reader) 14427 elif tag == 'expected_value': 14428 obj.expected_value = Reader.read_string(reader) 14429 elif tag == 'in_sync': 14430 obj.in_sync = Reader.read_boolean(reader) 14431 elif tag == 'name': 14432 obj.name = Reader.read_string(reader) 14433 else: 14434 reader.next_element() 14435 for link in links: 14436 ReportedConfigurationReader._process_link(link, obj) 14437 14438 # Discard the end tag: 14439 reader.read() 14440 14441 return obj 14442 14443 @staticmethod 14444 def read_many(reader): 14445 # Do nothing if there aren't more tags: 14446 objs = List() 14447 if not reader.forward(): 14448 return objs 14449 14450 # Process the attributes: 14451 objs.href = reader.get_attribute('href') 14452 14453 # Discard the start tag: 14454 empty = reader.empty_element() 14455 reader.read() 14456 if empty: 14457 return objs 14458 14459 # Process the inner elements: 14460 while reader.forward(): 14461 objs.append(ReportedConfigurationReader.read_one(reader)) 14462 14463 # Discard the end tag: 14464 reader.read() 14465 14466 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14403 @staticmethod 14404 def read_one(reader): 14405 # Do nothing if there aren't more tags: 14406 if not reader.forward(): 14407 return None 14408 14409 # Create the object: 14410 obj = types.ReportedConfiguration() 14411 14412 # Process the attributes: 14413 obj.href = reader.get_attribute('href') 14414 14415 # Discard the start tag: 14416 empty = reader.empty_element() 14417 reader.read() 14418 if empty: 14419 return obj 14420 14421 # Process the inner elements: 14422 links = [] 14423 while reader.forward(): 14424 tag = reader.node_name() 14425 if tag == 'actual_value': 14426 obj.actual_value = Reader.read_string(reader) 14427 elif tag == 'expected_value': 14428 obj.expected_value = Reader.read_string(reader) 14429 elif tag == 'in_sync': 14430 obj.in_sync = Reader.read_boolean(reader) 14431 elif tag == 'name': 14432 obj.name = Reader.read_string(reader) 14433 else: 14434 reader.next_element() 14435 for link in links: 14436 ReportedConfigurationReader._process_link(link, obj) 14437 14438 # Discard the end tag: 14439 reader.read() 14440 14441 return obj
14443 @staticmethod 14444 def read_many(reader): 14445 # Do nothing if there aren't more tags: 14446 objs = List() 14447 if not reader.forward(): 14448 return objs 14449 14450 # Process the attributes: 14451 objs.href = reader.get_attribute('href') 14452 14453 # Discard the start tag: 14454 empty = reader.empty_element() 14455 reader.read() 14456 if empty: 14457 return objs 14458 14459 # Process the inner elements: 14460 while reader.forward(): 14461 objs.append(ReportedConfigurationReader.read_one(reader)) 14462 14463 # Discard the end tag: 14464 reader.read() 14465 14466 return objs
14469class ReportedDeviceReader(Reader): 14470 14471 def __init__(self): 14472 super(ReportedDeviceReader, self).__init__() 14473 14474 @staticmethod 14475 def read_one(reader): 14476 # Do nothing if there aren't more tags: 14477 if not reader.forward(): 14478 return None 14479 14480 # Create the object: 14481 obj = types.ReportedDevice() 14482 14483 # Process the attributes: 14484 obj.href = reader.get_attribute('href') 14485 value = reader.get_attribute('id') 14486 if value is not None: 14487 obj.id = value 14488 14489 # Discard the start tag: 14490 empty = reader.empty_element() 14491 reader.read() 14492 if empty: 14493 return obj 14494 14495 # Process the inner elements: 14496 links = [] 14497 while reader.forward(): 14498 tag = reader.node_name() 14499 if tag == 'comment': 14500 obj.comment = Reader.read_string(reader) 14501 elif tag == 'description': 14502 obj.description = Reader.read_string(reader) 14503 elif tag == 'ips': 14504 obj.ips = IpReader.read_many(reader) 14505 elif tag == 'mac': 14506 obj.mac = MacReader.read_one(reader) 14507 elif tag == 'name': 14508 obj.name = Reader.read_string(reader) 14509 elif tag == 'type': 14510 obj.type = Reader.read_enum(types.ReportedDeviceType, reader) 14511 elif tag == 'vm': 14512 obj.vm = VmReader.read_one(reader) 14513 else: 14514 reader.next_element() 14515 for link in links: 14516 ReportedDeviceReader._process_link(link, obj) 14517 14518 # Discard the end tag: 14519 reader.read() 14520 14521 return obj 14522 14523 @staticmethod 14524 def read_many(reader): 14525 # Do nothing if there aren't more tags: 14526 objs = List() 14527 if not reader.forward(): 14528 return objs 14529 14530 # Process the attributes: 14531 objs.href = reader.get_attribute('href') 14532 14533 # Discard the start tag: 14534 empty = reader.empty_element() 14535 reader.read() 14536 if empty: 14537 return objs 14538 14539 # Process the inner elements: 14540 while reader.forward(): 14541 objs.append(ReportedDeviceReader.read_one(reader)) 14542 14543 # Discard the end tag: 14544 reader.read() 14545 14546 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14474 @staticmethod 14475 def read_one(reader): 14476 # Do nothing if there aren't more tags: 14477 if not reader.forward(): 14478 return None 14479 14480 # Create the object: 14481 obj = types.ReportedDevice() 14482 14483 # Process the attributes: 14484 obj.href = reader.get_attribute('href') 14485 value = reader.get_attribute('id') 14486 if value is not None: 14487 obj.id = value 14488 14489 # Discard the start tag: 14490 empty = reader.empty_element() 14491 reader.read() 14492 if empty: 14493 return obj 14494 14495 # Process the inner elements: 14496 links = [] 14497 while reader.forward(): 14498 tag = reader.node_name() 14499 if tag == 'comment': 14500 obj.comment = Reader.read_string(reader) 14501 elif tag == 'description': 14502 obj.description = Reader.read_string(reader) 14503 elif tag == 'ips': 14504 obj.ips = IpReader.read_many(reader) 14505 elif tag == 'mac': 14506 obj.mac = MacReader.read_one(reader) 14507 elif tag == 'name': 14508 obj.name = Reader.read_string(reader) 14509 elif tag == 'type': 14510 obj.type = Reader.read_enum(types.ReportedDeviceType, reader) 14511 elif tag == 'vm': 14512 obj.vm = VmReader.read_one(reader) 14513 else: 14514 reader.next_element() 14515 for link in links: 14516 ReportedDeviceReader._process_link(link, obj) 14517 14518 # Discard the end tag: 14519 reader.read() 14520 14521 return obj
14523 @staticmethod 14524 def read_many(reader): 14525 # Do nothing if there aren't more tags: 14526 objs = List() 14527 if not reader.forward(): 14528 return objs 14529 14530 # Process the attributes: 14531 objs.href = reader.get_attribute('href') 14532 14533 # Discard the start tag: 14534 empty = reader.empty_element() 14535 reader.read() 14536 if empty: 14537 return objs 14538 14539 # Process the inner elements: 14540 while reader.forward(): 14541 objs.append(ReportedDeviceReader.read_one(reader)) 14542 14543 # Discard the end tag: 14544 reader.read() 14545 14546 return objs
14549class RngDeviceReader(Reader): 14550 14551 def __init__(self): 14552 super(RngDeviceReader, self).__init__() 14553 14554 @staticmethod 14555 def read_one(reader): 14556 # Do nothing if there aren't more tags: 14557 if not reader.forward(): 14558 return None 14559 14560 # Create the object: 14561 obj = types.RngDevice() 14562 14563 # Process the attributes: 14564 obj.href = reader.get_attribute('href') 14565 14566 # Discard the start tag: 14567 empty = reader.empty_element() 14568 reader.read() 14569 if empty: 14570 return obj 14571 14572 # Process the inner elements: 14573 links = [] 14574 while reader.forward(): 14575 tag = reader.node_name() 14576 if tag == 'rate': 14577 obj.rate = RateReader.read_one(reader) 14578 elif tag == 'source': 14579 obj.source = Reader.read_enum(types.RngSource, reader) 14580 else: 14581 reader.next_element() 14582 for link in links: 14583 RngDeviceReader._process_link(link, obj) 14584 14585 # Discard the end tag: 14586 reader.read() 14587 14588 return obj 14589 14590 @staticmethod 14591 def read_many(reader): 14592 # Do nothing if there aren't more tags: 14593 objs = List() 14594 if not reader.forward(): 14595 return objs 14596 14597 # Process the attributes: 14598 objs.href = reader.get_attribute('href') 14599 14600 # Discard the start tag: 14601 empty = reader.empty_element() 14602 reader.read() 14603 if empty: 14604 return objs 14605 14606 # Process the inner elements: 14607 while reader.forward(): 14608 objs.append(RngDeviceReader.read_one(reader)) 14609 14610 # Discard the end tag: 14611 reader.read() 14612 14613 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14554 @staticmethod 14555 def read_one(reader): 14556 # Do nothing if there aren't more tags: 14557 if not reader.forward(): 14558 return None 14559 14560 # Create the object: 14561 obj = types.RngDevice() 14562 14563 # Process the attributes: 14564 obj.href = reader.get_attribute('href') 14565 14566 # Discard the start tag: 14567 empty = reader.empty_element() 14568 reader.read() 14569 if empty: 14570 return obj 14571 14572 # Process the inner elements: 14573 links = [] 14574 while reader.forward(): 14575 tag = reader.node_name() 14576 if tag == 'rate': 14577 obj.rate = RateReader.read_one(reader) 14578 elif tag == 'source': 14579 obj.source = Reader.read_enum(types.RngSource, reader) 14580 else: 14581 reader.next_element() 14582 for link in links: 14583 RngDeviceReader._process_link(link, obj) 14584 14585 # Discard the end tag: 14586 reader.read() 14587 14588 return obj
14590 @staticmethod 14591 def read_many(reader): 14592 # Do nothing if there aren't more tags: 14593 objs = List() 14594 if not reader.forward(): 14595 return objs 14596 14597 # Process the attributes: 14598 objs.href = reader.get_attribute('href') 14599 14600 # Discard the start tag: 14601 empty = reader.empty_element() 14602 reader.read() 14603 if empty: 14604 return objs 14605 14606 # Process the inner elements: 14607 while reader.forward(): 14608 objs.append(RngDeviceReader.read_one(reader)) 14609 14610 # Discard the end tag: 14611 reader.read() 14612 14613 return objs
14616class RoleReader(Reader): 14617 14618 def __init__(self): 14619 super(RoleReader, self).__init__() 14620 14621 @staticmethod 14622 def read_one(reader): 14623 # Do nothing if there aren't more tags: 14624 if not reader.forward(): 14625 return None 14626 14627 # Create the object: 14628 obj = types.Role() 14629 14630 # Process the attributes: 14631 obj.href = reader.get_attribute('href') 14632 value = reader.get_attribute('id') 14633 if value is not None: 14634 obj.id = value 14635 14636 # Discard the start tag: 14637 empty = reader.empty_element() 14638 reader.read() 14639 if empty: 14640 return obj 14641 14642 # Process the inner elements: 14643 links = [] 14644 while reader.forward(): 14645 tag = reader.node_name() 14646 if tag == 'administrative': 14647 obj.administrative = Reader.read_boolean(reader) 14648 elif tag == 'comment': 14649 obj.comment = Reader.read_string(reader) 14650 elif tag == 'description': 14651 obj.description = Reader.read_string(reader) 14652 elif tag == 'mutable': 14653 obj.mutable = Reader.read_boolean(reader) 14654 elif tag == 'name': 14655 obj.name = Reader.read_string(reader) 14656 elif tag == 'permits': 14657 obj.permits = PermitReader.read_many(reader) 14658 elif tag == 'user': 14659 obj.user = UserReader.read_one(reader) 14660 elif tag == 'link': 14661 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14662 reader.next_element() 14663 else: 14664 reader.next_element() 14665 for link in links: 14666 RoleReader._process_link(link, obj) 14667 14668 # Discard the end tag: 14669 reader.read() 14670 14671 return obj 14672 14673 @staticmethod 14674 def read_many(reader): 14675 # Do nothing if there aren't more tags: 14676 objs = List() 14677 if not reader.forward(): 14678 return objs 14679 14680 # Process the attributes: 14681 objs.href = reader.get_attribute('href') 14682 14683 # Discard the start tag: 14684 empty = reader.empty_element() 14685 reader.read() 14686 if empty: 14687 return objs 14688 14689 # Process the inner elements: 14690 while reader.forward(): 14691 objs.append(RoleReader.read_one(reader)) 14692 14693 # Discard the end tag: 14694 reader.read() 14695 14696 return objs 14697 14698 @staticmethod 14699 def _process_link(link, obj): 14700 # Process the attributes: 14701 rel = link[0] 14702 href = link[1] 14703 if href and rel: 14704 if rel == "permits": 14705 if obj.permits is not None: 14706 obj.permits.href = href 14707 else: 14708 obj.permits = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14621 @staticmethod 14622 def read_one(reader): 14623 # Do nothing if there aren't more tags: 14624 if not reader.forward(): 14625 return None 14626 14627 # Create the object: 14628 obj = types.Role() 14629 14630 # Process the attributes: 14631 obj.href = reader.get_attribute('href') 14632 value = reader.get_attribute('id') 14633 if value is not None: 14634 obj.id = value 14635 14636 # Discard the start tag: 14637 empty = reader.empty_element() 14638 reader.read() 14639 if empty: 14640 return obj 14641 14642 # Process the inner elements: 14643 links = [] 14644 while reader.forward(): 14645 tag = reader.node_name() 14646 if tag == 'administrative': 14647 obj.administrative = Reader.read_boolean(reader) 14648 elif tag == 'comment': 14649 obj.comment = Reader.read_string(reader) 14650 elif tag == 'description': 14651 obj.description = Reader.read_string(reader) 14652 elif tag == 'mutable': 14653 obj.mutable = Reader.read_boolean(reader) 14654 elif tag == 'name': 14655 obj.name = Reader.read_string(reader) 14656 elif tag == 'permits': 14657 obj.permits = PermitReader.read_many(reader) 14658 elif tag == 'user': 14659 obj.user = UserReader.read_one(reader) 14660 elif tag == 'link': 14661 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14662 reader.next_element() 14663 else: 14664 reader.next_element() 14665 for link in links: 14666 RoleReader._process_link(link, obj) 14667 14668 # Discard the end tag: 14669 reader.read() 14670 14671 return obj
14673 @staticmethod 14674 def read_many(reader): 14675 # Do nothing if there aren't more tags: 14676 objs = List() 14677 if not reader.forward(): 14678 return objs 14679 14680 # Process the attributes: 14681 objs.href = reader.get_attribute('href') 14682 14683 # Discard the start tag: 14684 empty = reader.empty_element() 14685 reader.read() 14686 if empty: 14687 return objs 14688 14689 # Process the inner elements: 14690 while reader.forward(): 14691 objs.append(RoleReader.read_one(reader)) 14692 14693 # Discard the end tag: 14694 reader.read() 14695 14696 return objs
14711class SchedulingPolicyReader(Reader): 14712 14713 def __init__(self): 14714 super(SchedulingPolicyReader, self).__init__() 14715 14716 @staticmethod 14717 def read_one(reader): 14718 # Do nothing if there aren't more tags: 14719 if not reader.forward(): 14720 return None 14721 14722 # Create the object: 14723 obj = types.SchedulingPolicy() 14724 14725 # Process the attributes: 14726 obj.href = reader.get_attribute('href') 14727 value = reader.get_attribute('id') 14728 if value is not None: 14729 obj.id = value 14730 14731 # Discard the start tag: 14732 empty = reader.empty_element() 14733 reader.read() 14734 if empty: 14735 return obj 14736 14737 # Process the inner elements: 14738 links = [] 14739 while reader.forward(): 14740 tag = reader.node_name() 14741 if tag == 'balances': 14742 obj.balances = BalanceReader.read_many(reader) 14743 elif tag == 'comment': 14744 obj.comment = Reader.read_string(reader) 14745 elif tag == 'default_policy': 14746 obj.default_policy = Reader.read_boolean(reader) 14747 elif tag == 'description': 14748 obj.description = Reader.read_string(reader) 14749 elif tag == 'filters': 14750 obj.filters = FilterReader.read_many(reader) 14751 elif tag == 'locked': 14752 obj.locked = Reader.read_boolean(reader) 14753 elif tag == 'name': 14754 obj.name = Reader.read_string(reader) 14755 elif tag == 'properties': 14756 obj.properties = PropertyReader.read_many(reader) 14757 elif tag == 'weight': 14758 obj.weight = WeightReader.read_many(reader) 14759 elif tag == 'link': 14760 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14761 reader.next_element() 14762 else: 14763 reader.next_element() 14764 for link in links: 14765 SchedulingPolicyReader._process_link(link, obj) 14766 14767 # Discard the end tag: 14768 reader.read() 14769 14770 return obj 14771 14772 @staticmethod 14773 def read_many(reader): 14774 # Do nothing if there aren't more tags: 14775 objs = List() 14776 if not reader.forward(): 14777 return objs 14778 14779 # Process the attributes: 14780 objs.href = reader.get_attribute('href') 14781 14782 # Discard the start tag: 14783 empty = reader.empty_element() 14784 reader.read() 14785 if empty: 14786 return objs 14787 14788 # Process the inner elements: 14789 while reader.forward(): 14790 objs.append(SchedulingPolicyReader.read_one(reader)) 14791 14792 # Discard the end tag: 14793 reader.read() 14794 14795 return objs 14796 14797 @staticmethod 14798 def _process_link(link, obj): 14799 # Process the attributes: 14800 rel = link[0] 14801 href = link[1] 14802 if href and rel: 14803 if rel == "balances": 14804 if obj.balances is not None: 14805 obj.balances.href = href 14806 else: 14807 obj.balances = List(href) 14808 elif rel == "filters": 14809 if obj.filters is not None: 14810 obj.filters.href = href 14811 else: 14812 obj.filters = List(href) 14813 elif rel == "weight": 14814 if obj.weight is not None: 14815 obj.weight.href = href 14816 else: 14817 obj.weight = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14716 @staticmethod 14717 def read_one(reader): 14718 # Do nothing if there aren't more tags: 14719 if not reader.forward(): 14720 return None 14721 14722 # Create the object: 14723 obj = types.SchedulingPolicy() 14724 14725 # Process the attributes: 14726 obj.href = reader.get_attribute('href') 14727 value = reader.get_attribute('id') 14728 if value is not None: 14729 obj.id = value 14730 14731 # Discard the start tag: 14732 empty = reader.empty_element() 14733 reader.read() 14734 if empty: 14735 return obj 14736 14737 # Process the inner elements: 14738 links = [] 14739 while reader.forward(): 14740 tag = reader.node_name() 14741 if tag == 'balances': 14742 obj.balances = BalanceReader.read_many(reader) 14743 elif tag == 'comment': 14744 obj.comment = Reader.read_string(reader) 14745 elif tag == 'default_policy': 14746 obj.default_policy = Reader.read_boolean(reader) 14747 elif tag == 'description': 14748 obj.description = Reader.read_string(reader) 14749 elif tag == 'filters': 14750 obj.filters = FilterReader.read_many(reader) 14751 elif tag == 'locked': 14752 obj.locked = Reader.read_boolean(reader) 14753 elif tag == 'name': 14754 obj.name = Reader.read_string(reader) 14755 elif tag == 'properties': 14756 obj.properties = PropertyReader.read_many(reader) 14757 elif tag == 'weight': 14758 obj.weight = WeightReader.read_many(reader) 14759 elif tag == 'link': 14760 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 14761 reader.next_element() 14762 else: 14763 reader.next_element() 14764 for link in links: 14765 SchedulingPolicyReader._process_link(link, obj) 14766 14767 # Discard the end tag: 14768 reader.read() 14769 14770 return obj
14772 @staticmethod 14773 def read_many(reader): 14774 # Do nothing if there aren't more tags: 14775 objs = List() 14776 if not reader.forward(): 14777 return objs 14778 14779 # Process the attributes: 14780 objs.href = reader.get_attribute('href') 14781 14782 # Discard the start tag: 14783 empty = reader.empty_element() 14784 reader.read() 14785 if empty: 14786 return objs 14787 14788 # Process the inner elements: 14789 while reader.forward(): 14790 objs.append(SchedulingPolicyReader.read_one(reader)) 14791 14792 # Discard the end tag: 14793 reader.read() 14794 14795 return objs
14820class SchedulingPolicyUnitReader(Reader): 14821 14822 def __init__(self): 14823 super(SchedulingPolicyUnitReader, self).__init__() 14824 14825 @staticmethod 14826 def read_one(reader): 14827 # Do nothing if there aren't more tags: 14828 if not reader.forward(): 14829 return None 14830 14831 # Create the object: 14832 obj = types.SchedulingPolicyUnit() 14833 14834 # Process the attributes: 14835 obj.href = reader.get_attribute('href') 14836 value = reader.get_attribute('id') 14837 if value is not None: 14838 obj.id = value 14839 14840 # Discard the start tag: 14841 empty = reader.empty_element() 14842 reader.read() 14843 if empty: 14844 return obj 14845 14846 # Process the inner elements: 14847 links = [] 14848 while reader.forward(): 14849 tag = reader.node_name() 14850 if tag == 'comment': 14851 obj.comment = Reader.read_string(reader) 14852 elif tag == 'description': 14853 obj.description = Reader.read_string(reader) 14854 elif tag == 'enabled': 14855 obj.enabled = Reader.read_boolean(reader) 14856 elif tag == 'internal': 14857 obj.internal = Reader.read_boolean(reader) 14858 elif tag == 'name': 14859 obj.name = Reader.read_string(reader) 14860 elif tag == 'properties': 14861 obj.properties = PropertyReader.read_many(reader) 14862 elif tag == 'type': 14863 obj.type = Reader.read_enum(types.PolicyUnitType, reader) 14864 else: 14865 reader.next_element() 14866 for link in links: 14867 SchedulingPolicyUnitReader._process_link(link, obj) 14868 14869 # Discard the end tag: 14870 reader.read() 14871 14872 return obj 14873 14874 @staticmethod 14875 def read_many(reader): 14876 # Do nothing if there aren't more tags: 14877 objs = List() 14878 if not reader.forward(): 14879 return objs 14880 14881 # Process the attributes: 14882 objs.href = reader.get_attribute('href') 14883 14884 # Discard the start tag: 14885 empty = reader.empty_element() 14886 reader.read() 14887 if empty: 14888 return objs 14889 14890 # Process the inner elements: 14891 while reader.forward(): 14892 objs.append(SchedulingPolicyUnitReader.read_one(reader)) 14893 14894 # Discard the end tag: 14895 reader.read() 14896 14897 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14825 @staticmethod 14826 def read_one(reader): 14827 # Do nothing if there aren't more tags: 14828 if not reader.forward(): 14829 return None 14830 14831 # Create the object: 14832 obj = types.SchedulingPolicyUnit() 14833 14834 # Process the attributes: 14835 obj.href = reader.get_attribute('href') 14836 value = reader.get_attribute('id') 14837 if value is not None: 14838 obj.id = value 14839 14840 # Discard the start tag: 14841 empty = reader.empty_element() 14842 reader.read() 14843 if empty: 14844 return obj 14845 14846 # Process the inner elements: 14847 links = [] 14848 while reader.forward(): 14849 tag = reader.node_name() 14850 if tag == 'comment': 14851 obj.comment = Reader.read_string(reader) 14852 elif tag == 'description': 14853 obj.description = Reader.read_string(reader) 14854 elif tag == 'enabled': 14855 obj.enabled = Reader.read_boolean(reader) 14856 elif tag == 'internal': 14857 obj.internal = Reader.read_boolean(reader) 14858 elif tag == 'name': 14859 obj.name = Reader.read_string(reader) 14860 elif tag == 'properties': 14861 obj.properties = PropertyReader.read_many(reader) 14862 elif tag == 'type': 14863 obj.type = Reader.read_enum(types.PolicyUnitType, reader) 14864 else: 14865 reader.next_element() 14866 for link in links: 14867 SchedulingPolicyUnitReader._process_link(link, obj) 14868 14869 # Discard the end tag: 14870 reader.read() 14871 14872 return obj
14874 @staticmethod 14875 def read_many(reader): 14876 # Do nothing if there aren't more tags: 14877 objs = List() 14878 if not reader.forward(): 14879 return objs 14880 14881 # Process the attributes: 14882 objs.href = reader.get_attribute('href') 14883 14884 # Discard the start tag: 14885 empty = reader.empty_element() 14886 reader.read() 14887 if empty: 14888 return objs 14889 14890 # Process the inner elements: 14891 while reader.forward(): 14892 objs.append(SchedulingPolicyUnitReader.read_one(reader)) 14893 14894 # Discard the end tag: 14895 reader.read() 14896 14897 return objs
14900class SeLinuxReader(Reader): 14901 14902 def __init__(self): 14903 super(SeLinuxReader, self).__init__() 14904 14905 @staticmethod 14906 def read_one(reader): 14907 # Do nothing if there aren't more tags: 14908 if not reader.forward(): 14909 return None 14910 14911 # Create the object: 14912 obj = types.SeLinux() 14913 14914 # Process the attributes: 14915 obj.href = reader.get_attribute('href') 14916 14917 # Discard the start tag: 14918 empty = reader.empty_element() 14919 reader.read() 14920 if empty: 14921 return obj 14922 14923 # Process the inner elements: 14924 links = [] 14925 while reader.forward(): 14926 tag = reader.node_name() 14927 if tag == 'mode': 14928 obj.mode = Reader.read_enum(types.SeLinuxMode, reader) 14929 else: 14930 reader.next_element() 14931 for link in links: 14932 SeLinuxReader._process_link(link, obj) 14933 14934 # Discard the end tag: 14935 reader.read() 14936 14937 return obj 14938 14939 @staticmethod 14940 def read_many(reader): 14941 # Do nothing if there aren't more tags: 14942 objs = List() 14943 if not reader.forward(): 14944 return objs 14945 14946 # Process the attributes: 14947 objs.href = reader.get_attribute('href') 14948 14949 # Discard the start tag: 14950 empty = reader.empty_element() 14951 reader.read() 14952 if empty: 14953 return objs 14954 14955 # Process the inner elements: 14956 while reader.forward(): 14957 objs.append(SeLinuxReader.read_one(reader)) 14958 14959 # Discard the end tag: 14960 reader.read() 14961 14962 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14905 @staticmethod 14906 def read_one(reader): 14907 # Do nothing if there aren't more tags: 14908 if not reader.forward(): 14909 return None 14910 14911 # Create the object: 14912 obj = types.SeLinux() 14913 14914 # Process the attributes: 14915 obj.href = reader.get_attribute('href') 14916 14917 # Discard the start tag: 14918 empty = reader.empty_element() 14919 reader.read() 14920 if empty: 14921 return obj 14922 14923 # Process the inner elements: 14924 links = [] 14925 while reader.forward(): 14926 tag = reader.node_name() 14927 if tag == 'mode': 14928 obj.mode = Reader.read_enum(types.SeLinuxMode, reader) 14929 else: 14930 reader.next_element() 14931 for link in links: 14932 SeLinuxReader._process_link(link, obj) 14933 14934 # Discard the end tag: 14935 reader.read() 14936 14937 return obj
14939 @staticmethod 14940 def read_many(reader): 14941 # Do nothing if there aren't more tags: 14942 objs = List() 14943 if not reader.forward(): 14944 return objs 14945 14946 # Process the attributes: 14947 objs.href = reader.get_attribute('href') 14948 14949 # Discard the start tag: 14950 empty = reader.empty_element() 14951 reader.read() 14952 if empty: 14953 return objs 14954 14955 # Process the inner elements: 14956 while reader.forward(): 14957 objs.append(SeLinuxReader.read_one(reader)) 14958 14959 # Discard the end tag: 14960 reader.read() 14961 14962 return objs
14965class SerialNumberReader(Reader): 14966 14967 def __init__(self): 14968 super(SerialNumberReader, self).__init__() 14969 14970 @staticmethod 14971 def read_one(reader): 14972 # Do nothing if there aren't more tags: 14973 if not reader.forward(): 14974 return None 14975 14976 # Create the object: 14977 obj = types.SerialNumber() 14978 14979 # Process the attributes: 14980 obj.href = reader.get_attribute('href') 14981 14982 # Discard the start tag: 14983 empty = reader.empty_element() 14984 reader.read() 14985 if empty: 14986 return obj 14987 14988 # Process the inner elements: 14989 links = [] 14990 while reader.forward(): 14991 tag = reader.node_name() 14992 if tag == 'policy': 14993 obj.policy = Reader.read_enum(types.SerialNumberPolicy, reader) 14994 elif tag == 'value': 14995 obj.value = Reader.read_string(reader) 14996 else: 14997 reader.next_element() 14998 for link in links: 14999 SerialNumberReader._process_link(link, obj) 15000 15001 # Discard the end tag: 15002 reader.read() 15003 15004 return obj 15005 15006 @staticmethod 15007 def read_many(reader): 15008 # Do nothing if there aren't more tags: 15009 objs = List() 15010 if not reader.forward(): 15011 return objs 15012 15013 # Process the attributes: 15014 objs.href = reader.get_attribute('href') 15015 15016 # Discard the start tag: 15017 empty = reader.empty_element() 15018 reader.read() 15019 if empty: 15020 return objs 15021 15022 # Process the inner elements: 15023 while reader.forward(): 15024 objs.append(SerialNumberReader.read_one(reader)) 15025 15026 # Discard the end tag: 15027 reader.read() 15028 15029 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
14970 @staticmethod 14971 def read_one(reader): 14972 # Do nothing if there aren't more tags: 14973 if not reader.forward(): 14974 return None 14975 14976 # Create the object: 14977 obj = types.SerialNumber() 14978 14979 # Process the attributes: 14980 obj.href = reader.get_attribute('href') 14981 14982 # Discard the start tag: 14983 empty = reader.empty_element() 14984 reader.read() 14985 if empty: 14986 return obj 14987 14988 # Process the inner elements: 14989 links = [] 14990 while reader.forward(): 14991 tag = reader.node_name() 14992 if tag == 'policy': 14993 obj.policy = Reader.read_enum(types.SerialNumberPolicy, reader) 14994 elif tag == 'value': 14995 obj.value = Reader.read_string(reader) 14996 else: 14997 reader.next_element() 14998 for link in links: 14999 SerialNumberReader._process_link(link, obj) 15000 15001 # Discard the end tag: 15002 reader.read() 15003 15004 return obj
15006 @staticmethod 15007 def read_many(reader): 15008 # Do nothing if there aren't more tags: 15009 objs = List() 15010 if not reader.forward(): 15011 return objs 15012 15013 # Process the attributes: 15014 objs.href = reader.get_attribute('href') 15015 15016 # Discard the start tag: 15017 empty = reader.empty_element() 15018 reader.read() 15019 if empty: 15020 return objs 15021 15022 # Process the inner elements: 15023 while reader.forward(): 15024 objs.append(SerialNumberReader.read_one(reader)) 15025 15026 # Discard the end tag: 15027 reader.read() 15028 15029 return objs
15032class SessionReader(Reader): 15033 15034 def __init__(self): 15035 super(SessionReader, self).__init__() 15036 15037 @staticmethod 15038 def read_one(reader): 15039 # Do nothing if there aren't more tags: 15040 if not reader.forward(): 15041 return None 15042 15043 # Create the object: 15044 obj = types.Session() 15045 15046 # Process the attributes: 15047 obj.href = reader.get_attribute('href') 15048 value = reader.get_attribute('id') 15049 if value is not None: 15050 obj.id = value 15051 15052 # Discard the start tag: 15053 empty = reader.empty_element() 15054 reader.read() 15055 if empty: 15056 return obj 15057 15058 # Process the inner elements: 15059 links = [] 15060 while reader.forward(): 15061 tag = reader.node_name() 15062 if tag == 'comment': 15063 obj.comment = Reader.read_string(reader) 15064 elif tag == 'console_user': 15065 obj.console_user = Reader.read_boolean(reader) 15066 elif tag == 'description': 15067 obj.description = Reader.read_string(reader) 15068 elif tag == 'ip': 15069 obj.ip = IpReader.read_one(reader) 15070 elif tag == 'name': 15071 obj.name = Reader.read_string(reader) 15072 elif tag == 'protocol': 15073 obj.protocol = Reader.read_string(reader) 15074 elif tag == 'user': 15075 obj.user = UserReader.read_one(reader) 15076 elif tag == 'vm': 15077 obj.vm = VmReader.read_one(reader) 15078 else: 15079 reader.next_element() 15080 for link in links: 15081 SessionReader._process_link(link, obj) 15082 15083 # Discard the end tag: 15084 reader.read() 15085 15086 return obj 15087 15088 @staticmethod 15089 def read_many(reader): 15090 # Do nothing if there aren't more tags: 15091 objs = List() 15092 if not reader.forward(): 15093 return objs 15094 15095 # Process the attributes: 15096 objs.href = reader.get_attribute('href') 15097 15098 # Discard the start tag: 15099 empty = reader.empty_element() 15100 reader.read() 15101 if empty: 15102 return objs 15103 15104 # Process the inner elements: 15105 while reader.forward(): 15106 objs.append(SessionReader.read_one(reader)) 15107 15108 # Discard the end tag: 15109 reader.read() 15110 15111 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15037 @staticmethod 15038 def read_one(reader): 15039 # Do nothing if there aren't more tags: 15040 if not reader.forward(): 15041 return None 15042 15043 # Create the object: 15044 obj = types.Session() 15045 15046 # Process the attributes: 15047 obj.href = reader.get_attribute('href') 15048 value = reader.get_attribute('id') 15049 if value is not None: 15050 obj.id = value 15051 15052 # Discard the start tag: 15053 empty = reader.empty_element() 15054 reader.read() 15055 if empty: 15056 return obj 15057 15058 # Process the inner elements: 15059 links = [] 15060 while reader.forward(): 15061 tag = reader.node_name() 15062 if tag == 'comment': 15063 obj.comment = Reader.read_string(reader) 15064 elif tag == 'console_user': 15065 obj.console_user = Reader.read_boolean(reader) 15066 elif tag == 'description': 15067 obj.description = Reader.read_string(reader) 15068 elif tag == 'ip': 15069 obj.ip = IpReader.read_one(reader) 15070 elif tag == 'name': 15071 obj.name = Reader.read_string(reader) 15072 elif tag == 'protocol': 15073 obj.protocol = Reader.read_string(reader) 15074 elif tag == 'user': 15075 obj.user = UserReader.read_one(reader) 15076 elif tag == 'vm': 15077 obj.vm = VmReader.read_one(reader) 15078 else: 15079 reader.next_element() 15080 for link in links: 15081 SessionReader._process_link(link, obj) 15082 15083 # Discard the end tag: 15084 reader.read() 15085 15086 return obj
15088 @staticmethod 15089 def read_many(reader): 15090 # Do nothing if there aren't more tags: 15091 objs = List() 15092 if not reader.forward(): 15093 return objs 15094 15095 # Process the attributes: 15096 objs.href = reader.get_attribute('href') 15097 15098 # Discard the start tag: 15099 empty = reader.empty_element() 15100 reader.read() 15101 if empty: 15102 return objs 15103 15104 # Process the inner elements: 15105 while reader.forward(): 15106 objs.append(SessionReader.read_one(reader)) 15107 15108 # Discard the end tag: 15109 reader.read() 15110 15111 return objs
15114class SkipIfConnectivityBrokenReader(Reader): 15115 15116 def __init__(self): 15117 super(SkipIfConnectivityBrokenReader, self).__init__() 15118 15119 @staticmethod 15120 def read_one(reader): 15121 # Do nothing if there aren't more tags: 15122 if not reader.forward(): 15123 return None 15124 15125 # Create the object: 15126 obj = types.SkipIfConnectivityBroken() 15127 15128 # Process the attributes: 15129 obj.href = reader.get_attribute('href') 15130 15131 # Discard the start tag: 15132 empty = reader.empty_element() 15133 reader.read() 15134 if empty: 15135 return obj 15136 15137 # Process the inner elements: 15138 links = [] 15139 while reader.forward(): 15140 tag = reader.node_name() 15141 if tag == 'enabled': 15142 obj.enabled = Reader.read_boolean(reader) 15143 elif tag == 'threshold': 15144 obj.threshold = Reader.read_integer(reader) 15145 else: 15146 reader.next_element() 15147 for link in links: 15148 SkipIfConnectivityBrokenReader._process_link(link, obj) 15149 15150 # Discard the end tag: 15151 reader.read() 15152 15153 return obj 15154 15155 @staticmethod 15156 def read_many(reader): 15157 # Do nothing if there aren't more tags: 15158 objs = List() 15159 if not reader.forward(): 15160 return objs 15161 15162 # Process the attributes: 15163 objs.href = reader.get_attribute('href') 15164 15165 # Discard the start tag: 15166 empty = reader.empty_element() 15167 reader.read() 15168 if empty: 15169 return objs 15170 15171 # Process the inner elements: 15172 while reader.forward(): 15173 objs.append(SkipIfConnectivityBrokenReader.read_one(reader)) 15174 15175 # Discard the end tag: 15176 reader.read() 15177 15178 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15119 @staticmethod 15120 def read_one(reader): 15121 # Do nothing if there aren't more tags: 15122 if not reader.forward(): 15123 return None 15124 15125 # Create the object: 15126 obj = types.SkipIfConnectivityBroken() 15127 15128 # Process the attributes: 15129 obj.href = reader.get_attribute('href') 15130 15131 # Discard the start tag: 15132 empty = reader.empty_element() 15133 reader.read() 15134 if empty: 15135 return obj 15136 15137 # Process the inner elements: 15138 links = [] 15139 while reader.forward(): 15140 tag = reader.node_name() 15141 if tag == 'enabled': 15142 obj.enabled = Reader.read_boolean(reader) 15143 elif tag == 'threshold': 15144 obj.threshold = Reader.read_integer(reader) 15145 else: 15146 reader.next_element() 15147 for link in links: 15148 SkipIfConnectivityBrokenReader._process_link(link, obj) 15149 15150 # Discard the end tag: 15151 reader.read() 15152 15153 return obj
15155 @staticmethod 15156 def read_many(reader): 15157 # Do nothing if there aren't more tags: 15158 objs = List() 15159 if not reader.forward(): 15160 return objs 15161 15162 # Process the attributes: 15163 objs.href = reader.get_attribute('href') 15164 15165 # Discard the start tag: 15166 empty = reader.empty_element() 15167 reader.read() 15168 if empty: 15169 return objs 15170 15171 # Process the inner elements: 15172 while reader.forward(): 15173 objs.append(SkipIfConnectivityBrokenReader.read_one(reader)) 15174 15175 # Discard the end tag: 15176 reader.read() 15177 15178 return objs
15181class SkipIfSdActiveReader(Reader): 15182 15183 def __init__(self): 15184 super(SkipIfSdActiveReader, self).__init__() 15185 15186 @staticmethod 15187 def read_one(reader): 15188 # Do nothing if there aren't more tags: 15189 if not reader.forward(): 15190 return None 15191 15192 # Create the object: 15193 obj = types.SkipIfSdActive() 15194 15195 # Process the attributes: 15196 obj.href = reader.get_attribute('href') 15197 15198 # Discard the start tag: 15199 empty = reader.empty_element() 15200 reader.read() 15201 if empty: 15202 return obj 15203 15204 # Process the inner elements: 15205 links = [] 15206 while reader.forward(): 15207 tag = reader.node_name() 15208 if tag == 'enabled': 15209 obj.enabled = Reader.read_boolean(reader) 15210 else: 15211 reader.next_element() 15212 for link in links: 15213 SkipIfSdActiveReader._process_link(link, obj) 15214 15215 # Discard the end tag: 15216 reader.read() 15217 15218 return obj 15219 15220 @staticmethod 15221 def read_many(reader): 15222 # Do nothing if there aren't more tags: 15223 objs = List() 15224 if not reader.forward(): 15225 return objs 15226 15227 # Process the attributes: 15228 objs.href = reader.get_attribute('href') 15229 15230 # Discard the start tag: 15231 empty = reader.empty_element() 15232 reader.read() 15233 if empty: 15234 return objs 15235 15236 # Process the inner elements: 15237 while reader.forward(): 15238 objs.append(SkipIfSdActiveReader.read_one(reader)) 15239 15240 # Discard the end tag: 15241 reader.read() 15242 15243 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15186 @staticmethod 15187 def read_one(reader): 15188 # Do nothing if there aren't more tags: 15189 if not reader.forward(): 15190 return None 15191 15192 # Create the object: 15193 obj = types.SkipIfSdActive() 15194 15195 # Process the attributes: 15196 obj.href = reader.get_attribute('href') 15197 15198 # Discard the start tag: 15199 empty = reader.empty_element() 15200 reader.read() 15201 if empty: 15202 return obj 15203 15204 # Process the inner elements: 15205 links = [] 15206 while reader.forward(): 15207 tag = reader.node_name() 15208 if tag == 'enabled': 15209 obj.enabled = Reader.read_boolean(reader) 15210 else: 15211 reader.next_element() 15212 for link in links: 15213 SkipIfSdActiveReader._process_link(link, obj) 15214 15215 # Discard the end tag: 15216 reader.read() 15217 15218 return obj
15220 @staticmethod 15221 def read_many(reader): 15222 # Do nothing if there aren't more tags: 15223 objs = List() 15224 if not reader.forward(): 15225 return objs 15226 15227 # Process the attributes: 15228 objs.href = reader.get_attribute('href') 15229 15230 # Discard the start tag: 15231 empty = reader.empty_element() 15232 reader.read() 15233 if empty: 15234 return objs 15235 15236 # Process the inner elements: 15237 while reader.forward(): 15238 objs.append(SkipIfSdActiveReader.read_one(reader)) 15239 15240 # Discard the end tag: 15241 reader.read() 15242 15243 return objs
15246class SnapshotReader(Reader): 15247 15248 def __init__(self): 15249 super(SnapshotReader, self).__init__() 15250 15251 @staticmethod 15252 def read_one(reader): 15253 # Do nothing if there aren't more tags: 15254 if not reader.forward(): 15255 return None 15256 15257 # Create the object: 15258 obj = types.Snapshot() 15259 15260 # Process the attributes: 15261 obj.href = reader.get_attribute('href') 15262 value = reader.get_attribute('id') 15263 if value is not None: 15264 obj.id = value 15265 15266 # Discard the start tag: 15267 empty = reader.empty_element() 15268 reader.read() 15269 if empty: 15270 return obj 15271 15272 # Process the inner elements: 15273 links = [] 15274 while reader.forward(): 15275 tag = reader.node_name() 15276 if tag == 'affinity_labels': 15277 obj.affinity_labels = AffinityLabelReader.read_many(reader) 15278 elif tag == 'applications': 15279 obj.applications = ApplicationReader.read_many(reader) 15280 elif tag == 'auto_pinning_policy': 15281 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 15282 elif tag == 'bios': 15283 obj.bios = BiosReader.read_one(reader) 15284 elif tag == 'cdroms': 15285 obj.cdroms = CdromReader.read_many(reader) 15286 elif tag == 'cluster': 15287 obj.cluster = ClusterReader.read_one(reader) 15288 elif tag == 'comment': 15289 obj.comment = Reader.read_string(reader) 15290 elif tag == 'console': 15291 obj.console = ConsoleReader.read_one(reader) 15292 elif tag == 'cpu': 15293 obj.cpu = CpuReader.read_one(reader) 15294 elif tag == 'cpu_pinning_policy': 15295 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 15296 elif tag == 'cpu_profile': 15297 obj.cpu_profile = CpuProfileReader.read_one(reader) 15298 elif tag == 'cpu_shares': 15299 obj.cpu_shares = Reader.read_integer(reader) 15300 elif tag == 'creation_time': 15301 obj.creation_time = Reader.read_date(reader) 15302 elif tag == 'custom_compatibility_version': 15303 obj.custom_compatibility_version = VersionReader.read_one(reader) 15304 elif tag == 'custom_cpu_model': 15305 obj.custom_cpu_model = Reader.read_string(reader) 15306 elif tag == 'custom_emulated_machine': 15307 obj.custom_emulated_machine = Reader.read_string(reader) 15308 elif tag == 'custom_properties': 15309 obj.custom_properties = CustomPropertyReader.read_many(reader) 15310 elif tag == 'date': 15311 obj.date = Reader.read_date(reader) 15312 elif tag == 'delete_protected': 15313 obj.delete_protected = Reader.read_boolean(reader) 15314 elif tag == 'description': 15315 obj.description = Reader.read_string(reader) 15316 elif tag == 'disk_attachments': 15317 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 15318 elif tag == 'disks': 15319 obj.disks = DiskReader.read_many(reader) 15320 elif tag == 'display': 15321 obj.display = DisplayReader.read_one(reader) 15322 elif tag == 'domain': 15323 obj.domain = DomainReader.read_one(reader) 15324 elif tag == 'dynamic_cpu': 15325 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 15326 elif tag == 'external_host_provider': 15327 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 15328 elif tag == 'floppies': 15329 obj.floppies = FloppyReader.read_many(reader) 15330 elif tag == 'fqdn': 15331 obj.fqdn = Reader.read_string(reader) 15332 elif tag == 'graphics_consoles': 15333 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 15334 elif tag == 'guest_operating_system': 15335 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 15336 elif tag == 'guest_time_zone': 15337 obj.guest_time_zone = TimeZoneReader.read_one(reader) 15338 elif tag == 'has_illegal_images': 15339 obj.has_illegal_images = Reader.read_boolean(reader) 15340 elif tag == 'high_availability': 15341 obj.high_availability = HighAvailabilityReader.read_one(reader) 15342 elif tag == 'host': 15343 obj.host = HostReader.read_one(reader) 15344 elif tag == 'host_devices': 15345 obj.host_devices = HostDeviceReader.read_many(reader) 15346 elif tag == 'initialization': 15347 obj.initialization = InitializationReader.read_one(reader) 15348 elif tag == 'instance_type': 15349 obj.instance_type = InstanceTypeReader.read_one(reader) 15350 elif tag == 'io': 15351 obj.io = IoReader.read_one(reader) 15352 elif tag == 'katello_errata': 15353 obj.katello_errata = KatelloErratumReader.read_many(reader) 15354 elif tag == 'large_icon': 15355 obj.large_icon = IconReader.read_one(reader) 15356 elif tag == 'lease': 15357 obj.lease = StorageDomainLeaseReader.read_one(reader) 15358 elif tag == 'mediated_devices': 15359 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 15360 elif tag == 'memory': 15361 obj.memory = Reader.read_integer(reader) 15362 elif tag == 'memory_policy': 15363 obj.memory_policy = MemoryPolicyReader.read_one(reader) 15364 elif tag == 'migration': 15365 obj.migration = MigrationOptionsReader.read_one(reader) 15366 elif tag == 'migration_downtime': 15367 obj.migration_downtime = Reader.read_integer(reader) 15368 elif tag == 'multi_queues_enabled': 15369 obj.multi_queues_enabled = Reader.read_boolean(reader) 15370 elif tag == 'name': 15371 obj.name = Reader.read_string(reader) 15372 elif tag == 'next_run_configuration_exists': 15373 obj.next_run_configuration_exists = Reader.read_boolean(reader) 15374 elif tag == 'nics': 15375 obj.nics = NicReader.read_many(reader) 15376 elif tag == 'host_numa_nodes': 15377 obj.numa_nodes = NumaNodeReader.read_many(reader) 15378 elif tag == 'numa_tune_mode': 15379 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 15380 elif tag == 'origin': 15381 obj.origin = Reader.read_string(reader) 15382 elif tag == 'original_template': 15383 obj.original_template = TemplateReader.read_one(reader) 15384 elif tag == 'os': 15385 obj.os = OperatingSystemReader.read_one(reader) 15386 elif tag == 'payloads': 15387 obj.payloads = PayloadReader.read_many(reader) 15388 elif tag == 'permissions': 15389 obj.permissions = PermissionReader.read_many(reader) 15390 elif tag == 'persist_memorystate': 15391 obj.persist_memorystate = Reader.read_boolean(reader) 15392 elif tag == 'placement_policy': 15393 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 15394 elif tag == 'quota': 15395 obj.quota = QuotaReader.read_one(reader) 15396 elif tag == 'reported_devices': 15397 obj.reported_devices = ReportedDeviceReader.read_many(reader) 15398 elif tag == 'rng_device': 15399 obj.rng_device = RngDeviceReader.read_one(reader) 15400 elif tag == 'run_once': 15401 obj.run_once = Reader.read_boolean(reader) 15402 elif tag == 'serial_number': 15403 obj.serial_number = SerialNumberReader.read_one(reader) 15404 elif tag == 'sessions': 15405 obj.sessions = SessionReader.read_many(reader) 15406 elif tag == 'small_icon': 15407 obj.small_icon = IconReader.read_one(reader) 15408 elif tag == 'snapshot_status': 15409 obj.snapshot_status = Reader.read_enum(types.SnapshotStatus, reader) 15410 elif tag == 'snapshot_type': 15411 obj.snapshot_type = Reader.read_enum(types.SnapshotType, reader) 15412 elif tag == 'snapshots': 15413 obj.snapshots = SnapshotReader.read_many(reader) 15414 elif tag == 'soundcard_enabled': 15415 obj.soundcard_enabled = Reader.read_boolean(reader) 15416 elif tag == 'sso': 15417 obj.sso = SsoReader.read_one(reader) 15418 elif tag == 'start_paused': 15419 obj.start_paused = Reader.read_boolean(reader) 15420 elif tag == 'start_time': 15421 obj.start_time = Reader.read_date(reader) 15422 elif tag == 'stateless': 15423 obj.stateless = Reader.read_boolean(reader) 15424 elif tag == 'statistics': 15425 obj.statistics = StatisticReader.read_many(reader) 15426 elif tag == 'status': 15427 obj.status = Reader.read_enum(types.VmStatus, reader) 15428 elif tag == 'status_detail': 15429 obj.status_detail = Reader.read_string(reader) 15430 elif tag == 'stop_reason': 15431 obj.stop_reason = Reader.read_string(reader) 15432 elif tag == 'stop_time': 15433 obj.stop_time = Reader.read_date(reader) 15434 elif tag == 'storage_domain': 15435 obj.storage_domain = StorageDomainReader.read_one(reader) 15436 elif tag == 'storage_error_resume_behaviour': 15437 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 15438 elif tag == 'tags': 15439 obj.tags = TagReader.read_many(reader) 15440 elif tag == 'template': 15441 obj.template = TemplateReader.read_one(reader) 15442 elif tag == 'time_zone': 15443 obj.time_zone = TimeZoneReader.read_one(reader) 15444 elif tag == 'tpm_enabled': 15445 obj.tpm_enabled = Reader.read_boolean(reader) 15446 elif tag == 'tunnel_migration': 15447 obj.tunnel_migration = Reader.read_boolean(reader) 15448 elif tag == 'type': 15449 obj.type = Reader.read_enum(types.VmType, reader) 15450 elif tag == 'usb': 15451 obj.usb = UsbReader.read_one(reader) 15452 elif tag == 'use_latest_template_version': 15453 obj.use_latest_template_version = Reader.read_boolean(reader) 15454 elif tag == 'virtio_scsi': 15455 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 15456 elif tag == 'virtio_scsi_multi_queues': 15457 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 15458 elif tag == 'virtio_scsi_multi_queues_enabled': 15459 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 15460 elif tag == 'vm': 15461 obj.vm = VmReader.read_one(reader) 15462 elif tag == 'vm_pool': 15463 obj.vm_pool = VmPoolReader.read_one(reader) 15464 elif tag == 'watchdogs': 15465 obj.watchdogs = WatchdogReader.read_many(reader) 15466 elif tag == 'link': 15467 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 15468 reader.next_element() 15469 else: 15470 reader.next_element() 15471 for link in links: 15472 SnapshotReader._process_link(link, obj) 15473 15474 # Discard the end tag: 15475 reader.read() 15476 15477 return obj 15478 15479 @staticmethod 15480 def read_many(reader): 15481 # Do nothing if there aren't more tags: 15482 objs = List() 15483 if not reader.forward(): 15484 return objs 15485 15486 # Process the attributes: 15487 objs.href = reader.get_attribute('href') 15488 15489 # Discard the start tag: 15490 empty = reader.empty_element() 15491 reader.read() 15492 if empty: 15493 return objs 15494 15495 # Process the inner elements: 15496 while reader.forward(): 15497 objs.append(SnapshotReader.read_one(reader)) 15498 15499 # Discard the end tag: 15500 reader.read() 15501 15502 return objs 15503 15504 @staticmethod 15505 def _process_link(link, obj): 15506 # Process the attributes: 15507 rel = link[0] 15508 href = link[1] 15509 if href and rel: 15510 if rel == "affinitylabels": 15511 if obj.affinity_labels is not None: 15512 obj.affinity_labels.href = href 15513 else: 15514 obj.affinity_labels = List(href) 15515 elif rel == "applications": 15516 if obj.applications is not None: 15517 obj.applications.href = href 15518 else: 15519 obj.applications = List(href) 15520 elif rel == "cdroms": 15521 if obj.cdroms is not None: 15522 obj.cdroms.href = href 15523 else: 15524 obj.cdroms = List(href) 15525 elif rel == "diskattachments": 15526 if obj.disk_attachments is not None: 15527 obj.disk_attachments.href = href 15528 else: 15529 obj.disk_attachments = List(href) 15530 elif rel == "disks": 15531 if obj.disks is not None: 15532 obj.disks.href = href 15533 else: 15534 obj.disks = List(href) 15535 elif rel == "floppies": 15536 if obj.floppies is not None: 15537 obj.floppies.href = href 15538 else: 15539 obj.floppies = List(href) 15540 elif rel == "graphicsconsoles": 15541 if obj.graphics_consoles is not None: 15542 obj.graphics_consoles.href = href 15543 else: 15544 obj.graphics_consoles = List(href) 15545 elif rel == "hostdevices": 15546 if obj.host_devices is not None: 15547 obj.host_devices.href = href 15548 else: 15549 obj.host_devices = List(href) 15550 elif rel == "katelloerrata": 15551 if obj.katello_errata is not None: 15552 obj.katello_errata.href = href 15553 else: 15554 obj.katello_errata = List(href) 15555 elif rel == "mediateddevices": 15556 if obj.mediated_devices is not None: 15557 obj.mediated_devices.href = href 15558 else: 15559 obj.mediated_devices = List(href) 15560 elif rel == "nics": 15561 if obj.nics is not None: 15562 obj.nics.href = href 15563 else: 15564 obj.nics = List(href) 15565 elif rel == "numanodes": 15566 if obj.numa_nodes is not None: 15567 obj.numa_nodes.href = href 15568 else: 15569 obj.numa_nodes = List(href) 15570 elif rel == "permissions": 15571 if obj.permissions is not None: 15572 obj.permissions.href = href 15573 else: 15574 obj.permissions = List(href) 15575 elif rel == "reporteddevices": 15576 if obj.reported_devices is not None: 15577 obj.reported_devices.href = href 15578 else: 15579 obj.reported_devices = List(href) 15580 elif rel == "sessions": 15581 if obj.sessions is not None: 15582 obj.sessions.href = href 15583 else: 15584 obj.sessions = List(href) 15585 elif rel == "snapshots": 15586 if obj.snapshots is not None: 15587 obj.snapshots.href = href 15588 else: 15589 obj.snapshots = List(href) 15590 elif rel == "statistics": 15591 if obj.statistics is not None: 15592 obj.statistics.href = href 15593 else: 15594 obj.statistics = List(href) 15595 elif rel == "tags": 15596 if obj.tags is not None: 15597 obj.tags.href = href 15598 else: 15599 obj.tags = List(href) 15600 elif rel == "watchdogs": 15601 if obj.watchdogs is not None: 15602 obj.watchdogs.href = href 15603 else: 15604 obj.watchdogs = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15251 @staticmethod 15252 def read_one(reader): 15253 # Do nothing if there aren't more tags: 15254 if not reader.forward(): 15255 return None 15256 15257 # Create the object: 15258 obj = types.Snapshot() 15259 15260 # Process the attributes: 15261 obj.href = reader.get_attribute('href') 15262 value = reader.get_attribute('id') 15263 if value is not None: 15264 obj.id = value 15265 15266 # Discard the start tag: 15267 empty = reader.empty_element() 15268 reader.read() 15269 if empty: 15270 return obj 15271 15272 # Process the inner elements: 15273 links = [] 15274 while reader.forward(): 15275 tag = reader.node_name() 15276 if tag == 'affinity_labels': 15277 obj.affinity_labels = AffinityLabelReader.read_many(reader) 15278 elif tag == 'applications': 15279 obj.applications = ApplicationReader.read_many(reader) 15280 elif tag == 'auto_pinning_policy': 15281 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 15282 elif tag == 'bios': 15283 obj.bios = BiosReader.read_one(reader) 15284 elif tag == 'cdroms': 15285 obj.cdroms = CdromReader.read_many(reader) 15286 elif tag == 'cluster': 15287 obj.cluster = ClusterReader.read_one(reader) 15288 elif tag == 'comment': 15289 obj.comment = Reader.read_string(reader) 15290 elif tag == 'console': 15291 obj.console = ConsoleReader.read_one(reader) 15292 elif tag == 'cpu': 15293 obj.cpu = CpuReader.read_one(reader) 15294 elif tag == 'cpu_pinning_policy': 15295 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 15296 elif tag == 'cpu_profile': 15297 obj.cpu_profile = CpuProfileReader.read_one(reader) 15298 elif tag == 'cpu_shares': 15299 obj.cpu_shares = Reader.read_integer(reader) 15300 elif tag == 'creation_time': 15301 obj.creation_time = Reader.read_date(reader) 15302 elif tag == 'custom_compatibility_version': 15303 obj.custom_compatibility_version = VersionReader.read_one(reader) 15304 elif tag == 'custom_cpu_model': 15305 obj.custom_cpu_model = Reader.read_string(reader) 15306 elif tag == 'custom_emulated_machine': 15307 obj.custom_emulated_machine = Reader.read_string(reader) 15308 elif tag == 'custom_properties': 15309 obj.custom_properties = CustomPropertyReader.read_many(reader) 15310 elif tag == 'date': 15311 obj.date = Reader.read_date(reader) 15312 elif tag == 'delete_protected': 15313 obj.delete_protected = Reader.read_boolean(reader) 15314 elif tag == 'description': 15315 obj.description = Reader.read_string(reader) 15316 elif tag == 'disk_attachments': 15317 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 15318 elif tag == 'disks': 15319 obj.disks = DiskReader.read_many(reader) 15320 elif tag == 'display': 15321 obj.display = DisplayReader.read_one(reader) 15322 elif tag == 'domain': 15323 obj.domain = DomainReader.read_one(reader) 15324 elif tag == 'dynamic_cpu': 15325 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 15326 elif tag == 'external_host_provider': 15327 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 15328 elif tag == 'floppies': 15329 obj.floppies = FloppyReader.read_many(reader) 15330 elif tag == 'fqdn': 15331 obj.fqdn = Reader.read_string(reader) 15332 elif tag == 'graphics_consoles': 15333 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 15334 elif tag == 'guest_operating_system': 15335 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 15336 elif tag == 'guest_time_zone': 15337 obj.guest_time_zone = TimeZoneReader.read_one(reader) 15338 elif tag == 'has_illegal_images': 15339 obj.has_illegal_images = Reader.read_boolean(reader) 15340 elif tag == 'high_availability': 15341 obj.high_availability = HighAvailabilityReader.read_one(reader) 15342 elif tag == 'host': 15343 obj.host = HostReader.read_one(reader) 15344 elif tag == 'host_devices': 15345 obj.host_devices = HostDeviceReader.read_many(reader) 15346 elif tag == 'initialization': 15347 obj.initialization = InitializationReader.read_one(reader) 15348 elif tag == 'instance_type': 15349 obj.instance_type = InstanceTypeReader.read_one(reader) 15350 elif tag == 'io': 15351 obj.io = IoReader.read_one(reader) 15352 elif tag == 'katello_errata': 15353 obj.katello_errata = KatelloErratumReader.read_many(reader) 15354 elif tag == 'large_icon': 15355 obj.large_icon = IconReader.read_one(reader) 15356 elif tag == 'lease': 15357 obj.lease = StorageDomainLeaseReader.read_one(reader) 15358 elif tag == 'mediated_devices': 15359 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 15360 elif tag == 'memory': 15361 obj.memory = Reader.read_integer(reader) 15362 elif tag == 'memory_policy': 15363 obj.memory_policy = MemoryPolicyReader.read_one(reader) 15364 elif tag == 'migration': 15365 obj.migration = MigrationOptionsReader.read_one(reader) 15366 elif tag == 'migration_downtime': 15367 obj.migration_downtime = Reader.read_integer(reader) 15368 elif tag == 'multi_queues_enabled': 15369 obj.multi_queues_enabled = Reader.read_boolean(reader) 15370 elif tag == 'name': 15371 obj.name = Reader.read_string(reader) 15372 elif tag == 'next_run_configuration_exists': 15373 obj.next_run_configuration_exists = Reader.read_boolean(reader) 15374 elif tag == 'nics': 15375 obj.nics = NicReader.read_many(reader) 15376 elif tag == 'host_numa_nodes': 15377 obj.numa_nodes = NumaNodeReader.read_many(reader) 15378 elif tag == 'numa_tune_mode': 15379 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 15380 elif tag == 'origin': 15381 obj.origin = Reader.read_string(reader) 15382 elif tag == 'original_template': 15383 obj.original_template = TemplateReader.read_one(reader) 15384 elif tag == 'os': 15385 obj.os = OperatingSystemReader.read_one(reader) 15386 elif tag == 'payloads': 15387 obj.payloads = PayloadReader.read_many(reader) 15388 elif tag == 'permissions': 15389 obj.permissions = PermissionReader.read_many(reader) 15390 elif tag == 'persist_memorystate': 15391 obj.persist_memorystate = Reader.read_boolean(reader) 15392 elif tag == 'placement_policy': 15393 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 15394 elif tag == 'quota': 15395 obj.quota = QuotaReader.read_one(reader) 15396 elif tag == 'reported_devices': 15397 obj.reported_devices = ReportedDeviceReader.read_many(reader) 15398 elif tag == 'rng_device': 15399 obj.rng_device = RngDeviceReader.read_one(reader) 15400 elif tag == 'run_once': 15401 obj.run_once = Reader.read_boolean(reader) 15402 elif tag == 'serial_number': 15403 obj.serial_number = SerialNumberReader.read_one(reader) 15404 elif tag == 'sessions': 15405 obj.sessions = SessionReader.read_many(reader) 15406 elif tag == 'small_icon': 15407 obj.small_icon = IconReader.read_one(reader) 15408 elif tag == 'snapshot_status': 15409 obj.snapshot_status = Reader.read_enum(types.SnapshotStatus, reader) 15410 elif tag == 'snapshot_type': 15411 obj.snapshot_type = Reader.read_enum(types.SnapshotType, reader) 15412 elif tag == 'snapshots': 15413 obj.snapshots = SnapshotReader.read_many(reader) 15414 elif tag == 'soundcard_enabled': 15415 obj.soundcard_enabled = Reader.read_boolean(reader) 15416 elif tag == 'sso': 15417 obj.sso = SsoReader.read_one(reader) 15418 elif tag == 'start_paused': 15419 obj.start_paused = Reader.read_boolean(reader) 15420 elif tag == 'start_time': 15421 obj.start_time = Reader.read_date(reader) 15422 elif tag == 'stateless': 15423 obj.stateless = Reader.read_boolean(reader) 15424 elif tag == 'statistics': 15425 obj.statistics = StatisticReader.read_many(reader) 15426 elif tag == 'status': 15427 obj.status = Reader.read_enum(types.VmStatus, reader) 15428 elif tag == 'status_detail': 15429 obj.status_detail = Reader.read_string(reader) 15430 elif tag == 'stop_reason': 15431 obj.stop_reason = Reader.read_string(reader) 15432 elif tag == 'stop_time': 15433 obj.stop_time = Reader.read_date(reader) 15434 elif tag == 'storage_domain': 15435 obj.storage_domain = StorageDomainReader.read_one(reader) 15436 elif tag == 'storage_error_resume_behaviour': 15437 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 15438 elif tag == 'tags': 15439 obj.tags = TagReader.read_many(reader) 15440 elif tag == 'template': 15441 obj.template = TemplateReader.read_one(reader) 15442 elif tag == 'time_zone': 15443 obj.time_zone = TimeZoneReader.read_one(reader) 15444 elif tag == 'tpm_enabled': 15445 obj.tpm_enabled = Reader.read_boolean(reader) 15446 elif tag == 'tunnel_migration': 15447 obj.tunnel_migration = Reader.read_boolean(reader) 15448 elif tag == 'type': 15449 obj.type = Reader.read_enum(types.VmType, reader) 15450 elif tag == 'usb': 15451 obj.usb = UsbReader.read_one(reader) 15452 elif tag == 'use_latest_template_version': 15453 obj.use_latest_template_version = Reader.read_boolean(reader) 15454 elif tag == 'virtio_scsi': 15455 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 15456 elif tag == 'virtio_scsi_multi_queues': 15457 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 15458 elif tag == 'virtio_scsi_multi_queues_enabled': 15459 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 15460 elif tag == 'vm': 15461 obj.vm = VmReader.read_one(reader) 15462 elif tag == 'vm_pool': 15463 obj.vm_pool = VmPoolReader.read_one(reader) 15464 elif tag == 'watchdogs': 15465 obj.watchdogs = WatchdogReader.read_many(reader) 15466 elif tag == 'link': 15467 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 15468 reader.next_element() 15469 else: 15470 reader.next_element() 15471 for link in links: 15472 SnapshotReader._process_link(link, obj) 15473 15474 # Discard the end tag: 15475 reader.read() 15476 15477 return obj
15479 @staticmethod 15480 def read_many(reader): 15481 # Do nothing if there aren't more tags: 15482 objs = List() 15483 if not reader.forward(): 15484 return objs 15485 15486 # Process the attributes: 15487 objs.href = reader.get_attribute('href') 15488 15489 # Discard the start tag: 15490 empty = reader.empty_element() 15491 reader.read() 15492 if empty: 15493 return objs 15494 15495 # Process the inner elements: 15496 while reader.forward(): 15497 objs.append(SnapshotReader.read_one(reader)) 15498 15499 # Discard the end tag: 15500 reader.read() 15501 15502 return objs
15607class SpecialObjectsReader(Reader): 15608 15609 def __init__(self): 15610 super(SpecialObjectsReader, self).__init__() 15611 15612 @staticmethod 15613 def read_one(reader): 15614 # Do nothing if there aren't more tags: 15615 if not reader.forward(): 15616 return None 15617 15618 # Create the object: 15619 obj = types.SpecialObjects() 15620 15621 # Process the attributes: 15622 obj.href = reader.get_attribute('href') 15623 15624 # Discard the start tag: 15625 empty = reader.empty_element() 15626 reader.read() 15627 if empty: 15628 return obj 15629 15630 # Process the inner elements: 15631 links = [] 15632 while reader.forward(): 15633 tag = reader.node_name() 15634 if tag == 'blank_template': 15635 obj.blank_template = TemplateReader.read_one(reader) 15636 elif tag == 'root_tag': 15637 obj.root_tag = TagReader.read_one(reader) 15638 else: 15639 reader.next_element() 15640 for link in links: 15641 SpecialObjectsReader._process_link(link, obj) 15642 15643 # Discard the end tag: 15644 reader.read() 15645 15646 return obj 15647 15648 @staticmethod 15649 def read_many(reader): 15650 # Do nothing if there aren't more tags: 15651 objs = List() 15652 if not reader.forward(): 15653 return objs 15654 15655 # Process the attributes: 15656 objs.href = reader.get_attribute('href') 15657 15658 # Discard the start tag: 15659 empty = reader.empty_element() 15660 reader.read() 15661 if empty: 15662 return objs 15663 15664 # Process the inner elements: 15665 while reader.forward(): 15666 objs.append(SpecialObjectsReader.read_one(reader)) 15667 15668 # Discard the end tag: 15669 reader.read() 15670 15671 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15612 @staticmethod 15613 def read_one(reader): 15614 # Do nothing if there aren't more tags: 15615 if not reader.forward(): 15616 return None 15617 15618 # Create the object: 15619 obj = types.SpecialObjects() 15620 15621 # Process the attributes: 15622 obj.href = reader.get_attribute('href') 15623 15624 # Discard the start tag: 15625 empty = reader.empty_element() 15626 reader.read() 15627 if empty: 15628 return obj 15629 15630 # Process the inner elements: 15631 links = [] 15632 while reader.forward(): 15633 tag = reader.node_name() 15634 if tag == 'blank_template': 15635 obj.blank_template = TemplateReader.read_one(reader) 15636 elif tag == 'root_tag': 15637 obj.root_tag = TagReader.read_one(reader) 15638 else: 15639 reader.next_element() 15640 for link in links: 15641 SpecialObjectsReader._process_link(link, obj) 15642 15643 # Discard the end tag: 15644 reader.read() 15645 15646 return obj
15648 @staticmethod 15649 def read_many(reader): 15650 # Do nothing if there aren't more tags: 15651 objs = List() 15652 if not reader.forward(): 15653 return objs 15654 15655 # Process the attributes: 15656 objs.href = reader.get_attribute('href') 15657 15658 # Discard the start tag: 15659 empty = reader.empty_element() 15660 reader.read() 15661 if empty: 15662 return objs 15663 15664 # Process the inner elements: 15665 while reader.forward(): 15666 objs.append(SpecialObjectsReader.read_one(reader)) 15667 15668 # Discard the end tag: 15669 reader.read() 15670 15671 return objs
15674class SpmReader(Reader): 15675 15676 def __init__(self): 15677 super(SpmReader, self).__init__() 15678 15679 @staticmethod 15680 def read_one(reader): 15681 # Do nothing if there aren't more tags: 15682 if not reader.forward(): 15683 return None 15684 15685 # Create the object: 15686 obj = types.Spm() 15687 15688 # Process the attributes: 15689 obj.href = reader.get_attribute('href') 15690 15691 # Discard the start tag: 15692 empty = reader.empty_element() 15693 reader.read() 15694 if empty: 15695 return obj 15696 15697 # Process the inner elements: 15698 links = [] 15699 while reader.forward(): 15700 tag = reader.node_name() 15701 if tag == 'priority': 15702 obj.priority = Reader.read_integer(reader) 15703 elif tag == 'status': 15704 obj.status = Reader.read_enum(types.SpmStatus, reader) 15705 else: 15706 reader.next_element() 15707 for link in links: 15708 SpmReader._process_link(link, obj) 15709 15710 # Discard the end tag: 15711 reader.read() 15712 15713 return obj 15714 15715 @staticmethod 15716 def read_many(reader): 15717 # Do nothing if there aren't more tags: 15718 objs = List() 15719 if not reader.forward(): 15720 return objs 15721 15722 # Process the attributes: 15723 objs.href = reader.get_attribute('href') 15724 15725 # Discard the start tag: 15726 empty = reader.empty_element() 15727 reader.read() 15728 if empty: 15729 return objs 15730 15731 # Process the inner elements: 15732 while reader.forward(): 15733 objs.append(SpmReader.read_one(reader)) 15734 15735 # Discard the end tag: 15736 reader.read() 15737 15738 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15679 @staticmethod 15680 def read_one(reader): 15681 # Do nothing if there aren't more tags: 15682 if not reader.forward(): 15683 return None 15684 15685 # Create the object: 15686 obj = types.Spm() 15687 15688 # Process the attributes: 15689 obj.href = reader.get_attribute('href') 15690 15691 # Discard the start tag: 15692 empty = reader.empty_element() 15693 reader.read() 15694 if empty: 15695 return obj 15696 15697 # Process the inner elements: 15698 links = [] 15699 while reader.forward(): 15700 tag = reader.node_name() 15701 if tag == 'priority': 15702 obj.priority = Reader.read_integer(reader) 15703 elif tag == 'status': 15704 obj.status = Reader.read_enum(types.SpmStatus, reader) 15705 else: 15706 reader.next_element() 15707 for link in links: 15708 SpmReader._process_link(link, obj) 15709 15710 # Discard the end tag: 15711 reader.read() 15712 15713 return obj
15715 @staticmethod 15716 def read_many(reader): 15717 # Do nothing if there aren't more tags: 15718 objs = List() 15719 if not reader.forward(): 15720 return objs 15721 15722 # Process the attributes: 15723 objs.href = reader.get_attribute('href') 15724 15725 # Discard the start tag: 15726 empty = reader.empty_element() 15727 reader.read() 15728 if empty: 15729 return objs 15730 15731 # Process the inner elements: 15732 while reader.forward(): 15733 objs.append(SpmReader.read_one(reader)) 15734 15735 # Discard the end tag: 15736 reader.read() 15737 15738 return objs
15741class SshReader(Reader): 15742 15743 def __init__(self): 15744 super(SshReader, self).__init__() 15745 15746 @staticmethod 15747 def read_one(reader): 15748 # Do nothing if there aren't more tags: 15749 if not reader.forward(): 15750 return None 15751 15752 # Create the object: 15753 obj = types.Ssh() 15754 15755 # Process the attributes: 15756 obj.href = reader.get_attribute('href') 15757 value = reader.get_attribute('id') 15758 if value is not None: 15759 obj.id = value 15760 15761 # Discard the start tag: 15762 empty = reader.empty_element() 15763 reader.read() 15764 if empty: 15765 return obj 15766 15767 # Process the inner elements: 15768 links = [] 15769 while reader.forward(): 15770 tag = reader.node_name() 15771 if tag == 'authentication_method': 15772 obj.authentication_method = Reader.read_enum(types.SshAuthenticationMethod, reader) 15773 elif tag == 'comment': 15774 obj.comment = Reader.read_string(reader) 15775 elif tag == 'description': 15776 obj.description = Reader.read_string(reader) 15777 elif tag == 'fingerprint': 15778 obj.fingerprint = Reader.read_string(reader) 15779 elif tag == 'name': 15780 obj.name = Reader.read_string(reader) 15781 elif tag == 'port': 15782 obj.port = Reader.read_integer(reader) 15783 elif tag == 'public_key': 15784 obj.public_key = Reader.read_string(reader) 15785 elif tag == 'user': 15786 obj.user = UserReader.read_one(reader) 15787 else: 15788 reader.next_element() 15789 for link in links: 15790 SshReader._process_link(link, obj) 15791 15792 # Discard the end tag: 15793 reader.read() 15794 15795 return obj 15796 15797 @staticmethod 15798 def read_many(reader): 15799 # Do nothing if there aren't more tags: 15800 objs = List() 15801 if not reader.forward(): 15802 return objs 15803 15804 # Process the attributes: 15805 objs.href = reader.get_attribute('href') 15806 15807 # Discard the start tag: 15808 empty = reader.empty_element() 15809 reader.read() 15810 if empty: 15811 return objs 15812 15813 # Process the inner elements: 15814 while reader.forward(): 15815 objs.append(SshReader.read_one(reader)) 15816 15817 # Discard the end tag: 15818 reader.read() 15819 15820 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15746 @staticmethod 15747 def read_one(reader): 15748 # Do nothing if there aren't more tags: 15749 if not reader.forward(): 15750 return None 15751 15752 # Create the object: 15753 obj = types.Ssh() 15754 15755 # Process the attributes: 15756 obj.href = reader.get_attribute('href') 15757 value = reader.get_attribute('id') 15758 if value is not None: 15759 obj.id = value 15760 15761 # Discard the start tag: 15762 empty = reader.empty_element() 15763 reader.read() 15764 if empty: 15765 return obj 15766 15767 # Process the inner elements: 15768 links = [] 15769 while reader.forward(): 15770 tag = reader.node_name() 15771 if tag == 'authentication_method': 15772 obj.authentication_method = Reader.read_enum(types.SshAuthenticationMethod, reader) 15773 elif tag == 'comment': 15774 obj.comment = Reader.read_string(reader) 15775 elif tag == 'description': 15776 obj.description = Reader.read_string(reader) 15777 elif tag == 'fingerprint': 15778 obj.fingerprint = Reader.read_string(reader) 15779 elif tag == 'name': 15780 obj.name = Reader.read_string(reader) 15781 elif tag == 'port': 15782 obj.port = Reader.read_integer(reader) 15783 elif tag == 'public_key': 15784 obj.public_key = Reader.read_string(reader) 15785 elif tag == 'user': 15786 obj.user = UserReader.read_one(reader) 15787 else: 15788 reader.next_element() 15789 for link in links: 15790 SshReader._process_link(link, obj) 15791 15792 # Discard the end tag: 15793 reader.read() 15794 15795 return obj
15797 @staticmethod 15798 def read_many(reader): 15799 # Do nothing if there aren't more tags: 15800 objs = List() 15801 if not reader.forward(): 15802 return objs 15803 15804 # Process the attributes: 15805 objs.href = reader.get_attribute('href') 15806 15807 # Discard the start tag: 15808 empty = reader.empty_element() 15809 reader.read() 15810 if empty: 15811 return objs 15812 15813 # Process the inner elements: 15814 while reader.forward(): 15815 objs.append(SshReader.read_one(reader)) 15816 15817 # Discard the end tag: 15818 reader.read() 15819 15820 return objs
15823class SshPublicKeyReader(Reader): 15824 15825 def __init__(self): 15826 super(SshPublicKeyReader, self).__init__() 15827 15828 @staticmethod 15829 def read_one(reader): 15830 # Do nothing if there aren't more tags: 15831 if not reader.forward(): 15832 return None 15833 15834 # Create the object: 15835 obj = types.SshPublicKey() 15836 15837 # Process the attributes: 15838 obj.href = reader.get_attribute('href') 15839 value = reader.get_attribute('id') 15840 if value is not None: 15841 obj.id = value 15842 15843 # Discard the start tag: 15844 empty = reader.empty_element() 15845 reader.read() 15846 if empty: 15847 return obj 15848 15849 # Process the inner elements: 15850 links = [] 15851 while reader.forward(): 15852 tag = reader.node_name() 15853 if tag == 'comment': 15854 obj.comment = Reader.read_string(reader) 15855 elif tag == 'content': 15856 obj.content = Reader.read_string(reader) 15857 elif tag == 'description': 15858 obj.description = Reader.read_string(reader) 15859 elif tag == 'name': 15860 obj.name = Reader.read_string(reader) 15861 elif tag == 'user': 15862 obj.user = UserReader.read_one(reader) 15863 else: 15864 reader.next_element() 15865 for link in links: 15866 SshPublicKeyReader._process_link(link, obj) 15867 15868 # Discard the end tag: 15869 reader.read() 15870 15871 return obj 15872 15873 @staticmethod 15874 def read_many(reader): 15875 # Do nothing if there aren't more tags: 15876 objs = List() 15877 if not reader.forward(): 15878 return objs 15879 15880 # Process the attributes: 15881 objs.href = reader.get_attribute('href') 15882 15883 # Discard the start tag: 15884 empty = reader.empty_element() 15885 reader.read() 15886 if empty: 15887 return objs 15888 15889 # Process the inner elements: 15890 while reader.forward(): 15891 objs.append(SshPublicKeyReader.read_one(reader)) 15892 15893 # Discard the end tag: 15894 reader.read() 15895 15896 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15828 @staticmethod 15829 def read_one(reader): 15830 # Do nothing if there aren't more tags: 15831 if not reader.forward(): 15832 return None 15833 15834 # Create the object: 15835 obj = types.SshPublicKey() 15836 15837 # Process the attributes: 15838 obj.href = reader.get_attribute('href') 15839 value = reader.get_attribute('id') 15840 if value is not None: 15841 obj.id = value 15842 15843 # Discard the start tag: 15844 empty = reader.empty_element() 15845 reader.read() 15846 if empty: 15847 return obj 15848 15849 # Process the inner elements: 15850 links = [] 15851 while reader.forward(): 15852 tag = reader.node_name() 15853 if tag == 'comment': 15854 obj.comment = Reader.read_string(reader) 15855 elif tag == 'content': 15856 obj.content = Reader.read_string(reader) 15857 elif tag == 'description': 15858 obj.description = Reader.read_string(reader) 15859 elif tag == 'name': 15860 obj.name = Reader.read_string(reader) 15861 elif tag == 'user': 15862 obj.user = UserReader.read_one(reader) 15863 else: 15864 reader.next_element() 15865 for link in links: 15866 SshPublicKeyReader._process_link(link, obj) 15867 15868 # Discard the end tag: 15869 reader.read() 15870 15871 return obj
15873 @staticmethod 15874 def read_many(reader): 15875 # Do nothing if there aren't more tags: 15876 objs = List() 15877 if not reader.forward(): 15878 return objs 15879 15880 # Process the attributes: 15881 objs.href = reader.get_attribute('href') 15882 15883 # Discard the start tag: 15884 empty = reader.empty_element() 15885 reader.read() 15886 if empty: 15887 return objs 15888 15889 # Process the inner elements: 15890 while reader.forward(): 15891 objs.append(SshPublicKeyReader.read_one(reader)) 15892 15893 # Discard the end tag: 15894 reader.read() 15895 15896 return objs
15899class SsoReader(Reader): 15900 15901 def __init__(self): 15902 super(SsoReader, self).__init__() 15903 15904 @staticmethod 15905 def read_one(reader): 15906 # Do nothing if there aren't more tags: 15907 if not reader.forward(): 15908 return None 15909 15910 # Create the object: 15911 obj = types.Sso() 15912 15913 # Process the attributes: 15914 obj.href = reader.get_attribute('href') 15915 15916 # Discard the start tag: 15917 empty = reader.empty_element() 15918 reader.read() 15919 if empty: 15920 return obj 15921 15922 # Process the inner elements: 15923 links = [] 15924 while reader.forward(): 15925 tag = reader.node_name() 15926 if tag == 'methods': 15927 obj.methods = MethodReader.read_many(reader) 15928 else: 15929 reader.next_element() 15930 for link in links: 15931 SsoReader._process_link(link, obj) 15932 15933 # Discard the end tag: 15934 reader.read() 15935 15936 return obj 15937 15938 @staticmethod 15939 def read_many(reader): 15940 # Do nothing if there aren't more tags: 15941 objs = List() 15942 if not reader.forward(): 15943 return objs 15944 15945 # Process the attributes: 15946 objs.href = reader.get_attribute('href') 15947 15948 # Discard the start tag: 15949 empty = reader.empty_element() 15950 reader.read() 15951 if empty: 15952 return objs 15953 15954 # Process the inner elements: 15955 while reader.forward(): 15956 objs.append(SsoReader.read_one(reader)) 15957 15958 # Discard the end tag: 15959 reader.read() 15960 15961 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15904 @staticmethod 15905 def read_one(reader): 15906 # Do nothing if there aren't more tags: 15907 if not reader.forward(): 15908 return None 15909 15910 # Create the object: 15911 obj = types.Sso() 15912 15913 # Process the attributes: 15914 obj.href = reader.get_attribute('href') 15915 15916 # Discard the start tag: 15917 empty = reader.empty_element() 15918 reader.read() 15919 if empty: 15920 return obj 15921 15922 # Process the inner elements: 15923 links = [] 15924 while reader.forward(): 15925 tag = reader.node_name() 15926 if tag == 'methods': 15927 obj.methods = MethodReader.read_many(reader) 15928 else: 15929 reader.next_element() 15930 for link in links: 15931 SsoReader._process_link(link, obj) 15932 15933 # Discard the end tag: 15934 reader.read() 15935 15936 return obj
15938 @staticmethod 15939 def read_many(reader): 15940 # Do nothing if there aren't more tags: 15941 objs = List() 15942 if not reader.forward(): 15943 return objs 15944 15945 # Process the attributes: 15946 objs.href = reader.get_attribute('href') 15947 15948 # Discard the start tag: 15949 empty = reader.empty_element() 15950 reader.read() 15951 if empty: 15952 return objs 15953 15954 # Process the inner elements: 15955 while reader.forward(): 15956 objs.append(SsoReader.read_one(reader)) 15957 15958 # Discard the end tag: 15959 reader.read() 15960 15961 return objs
15964class StatisticReader(Reader): 15965 15966 def __init__(self): 15967 super(StatisticReader, self).__init__() 15968 15969 @staticmethod 15970 def read_one(reader): 15971 # Do nothing if there aren't more tags: 15972 if not reader.forward(): 15973 return None 15974 15975 # Create the object: 15976 obj = types.Statistic() 15977 15978 # Process the attributes: 15979 obj.href = reader.get_attribute('href') 15980 value = reader.get_attribute('id') 15981 if value is not None: 15982 obj.id = value 15983 15984 # Discard the start tag: 15985 empty = reader.empty_element() 15986 reader.read() 15987 if empty: 15988 return obj 15989 15990 # Process the inner elements: 15991 links = [] 15992 while reader.forward(): 15993 tag = reader.node_name() 15994 if tag == 'brick': 15995 obj.brick = GlusterBrickReader.read_one(reader) 15996 elif tag == 'comment': 15997 obj.comment = Reader.read_string(reader) 15998 elif tag == 'description': 15999 obj.description = Reader.read_string(reader) 16000 elif tag == 'disk': 16001 obj.disk = DiskReader.read_one(reader) 16002 elif tag == 'gluster_volume': 16003 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16004 elif tag == 'host': 16005 obj.host = HostReader.read_one(reader) 16006 elif tag == 'host_nic': 16007 obj.host_nic = HostNicReader.read_one(reader) 16008 elif tag == 'host_numa_node': 16009 obj.host_numa_node = NumaNodeReader.read_one(reader) 16010 elif tag == 'kind': 16011 obj.kind = Reader.read_enum(types.StatisticKind, reader) 16012 elif tag == 'name': 16013 obj.name = Reader.read_string(reader) 16014 elif tag == 'nic': 16015 obj.nic = NicReader.read_one(reader) 16016 elif tag == 'step': 16017 obj.step = StepReader.read_one(reader) 16018 elif tag == 'type': 16019 obj.type = Reader.read_enum(types.ValueType, reader) 16020 elif tag == 'unit': 16021 obj.unit = Reader.read_enum(types.StatisticUnit, reader) 16022 elif tag == 'values': 16023 obj.values = ValueReader.read_many(reader) 16024 elif tag == 'vm': 16025 obj.vm = VmReader.read_one(reader) 16026 else: 16027 reader.next_element() 16028 for link in links: 16029 StatisticReader._process_link(link, obj) 16030 16031 # Discard the end tag: 16032 reader.read() 16033 16034 return obj 16035 16036 @staticmethod 16037 def read_many(reader): 16038 # Do nothing if there aren't more tags: 16039 objs = List() 16040 if not reader.forward(): 16041 return objs 16042 16043 # Process the attributes: 16044 objs.href = reader.get_attribute('href') 16045 16046 # Discard the start tag: 16047 empty = reader.empty_element() 16048 reader.read() 16049 if empty: 16050 return objs 16051 16052 # Process the inner elements: 16053 while reader.forward(): 16054 objs.append(StatisticReader.read_one(reader)) 16055 16056 # Discard the end tag: 16057 reader.read() 16058 16059 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
15969 @staticmethod 15970 def read_one(reader): 15971 # Do nothing if there aren't more tags: 15972 if not reader.forward(): 15973 return None 15974 15975 # Create the object: 15976 obj = types.Statistic() 15977 15978 # Process the attributes: 15979 obj.href = reader.get_attribute('href') 15980 value = reader.get_attribute('id') 15981 if value is not None: 15982 obj.id = value 15983 15984 # Discard the start tag: 15985 empty = reader.empty_element() 15986 reader.read() 15987 if empty: 15988 return obj 15989 15990 # Process the inner elements: 15991 links = [] 15992 while reader.forward(): 15993 tag = reader.node_name() 15994 if tag == 'brick': 15995 obj.brick = GlusterBrickReader.read_one(reader) 15996 elif tag == 'comment': 15997 obj.comment = Reader.read_string(reader) 15998 elif tag == 'description': 15999 obj.description = Reader.read_string(reader) 16000 elif tag == 'disk': 16001 obj.disk = DiskReader.read_one(reader) 16002 elif tag == 'gluster_volume': 16003 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16004 elif tag == 'host': 16005 obj.host = HostReader.read_one(reader) 16006 elif tag == 'host_nic': 16007 obj.host_nic = HostNicReader.read_one(reader) 16008 elif tag == 'host_numa_node': 16009 obj.host_numa_node = NumaNodeReader.read_one(reader) 16010 elif tag == 'kind': 16011 obj.kind = Reader.read_enum(types.StatisticKind, reader) 16012 elif tag == 'name': 16013 obj.name = Reader.read_string(reader) 16014 elif tag == 'nic': 16015 obj.nic = NicReader.read_one(reader) 16016 elif tag == 'step': 16017 obj.step = StepReader.read_one(reader) 16018 elif tag == 'type': 16019 obj.type = Reader.read_enum(types.ValueType, reader) 16020 elif tag == 'unit': 16021 obj.unit = Reader.read_enum(types.StatisticUnit, reader) 16022 elif tag == 'values': 16023 obj.values = ValueReader.read_many(reader) 16024 elif tag == 'vm': 16025 obj.vm = VmReader.read_one(reader) 16026 else: 16027 reader.next_element() 16028 for link in links: 16029 StatisticReader._process_link(link, obj) 16030 16031 # Discard the end tag: 16032 reader.read() 16033 16034 return obj
16036 @staticmethod 16037 def read_many(reader): 16038 # Do nothing if there aren't more tags: 16039 objs = List() 16040 if not reader.forward(): 16041 return objs 16042 16043 # Process the attributes: 16044 objs.href = reader.get_attribute('href') 16045 16046 # Discard the start tag: 16047 empty = reader.empty_element() 16048 reader.read() 16049 if empty: 16050 return objs 16051 16052 # Process the inner elements: 16053 while reader.forward(): 16054 objs.append(StatisticReader.read_one(reader)) 16055 16056 # Discard the end tag: 16057 reader.read() 16058 16059 return objs
16062class StepReader(Reader): 16063 16064 def __init__(self): 16065 super(StepReader, self).__init__() 16066 16067 @staticmethod 16068 def read_one(reader): 16069 # Do nothing if there aren't more tags: 16070 if not reader.forward(): 16071 return None 16072 16073 # Create the object: 16074 obj = types.Step() 16075 16076 # Process the attributes: 16077 obj.href = reader.get_attribute('href') 16078 value = reader.get_attribute('id') 16079 if value is not None: 16080 obj.id = value 16081 16082 # Discard the start tag: 16083 empty = reader.empty_element() 16084 reader.read() 16085 if empty: 16086 return obj 16087 16088 # Process the inner elements: 16089 links = [] 16090 while reader.forward(): 16091 tag = reader.node_name() 16092 if tag == 'comment': 16093 obj.comment = Reader.read_string(reader) 16094 elif tag == 'description': 16095 obj.description = Reader.read_string(reader) 16096 elif tag == 'end_time': 16097 obj.end_time = Reader.read_date(reader) 16098 elif tag == 'execution_host': 16099 obj.execution_host = HostReader.read_one(reader) 16100 elif tag == 'external': 16101 obj.external = Reader.read_boolean(reader) 16102 elif tag == 'external_type': 16103 obj.external_type = Reader.read_enum(types.ExternalSystemType, reader) 16104 elif tag == 'job': 16105 obj.job = JobReader.read_one(reader) 16106 elif tag == 'name': 16107 obj.name = Reader.read_string(reader) 16108 elif tag == 'number': 16109 obj.number = Reader.read_integer(reader) 16110 elif tag == 'parent_step': 16111 obj.parent_step = StepReader.read_one(reader) 16112 elif tag == 'progress': 16113 obj.progress = Reader.read_integer(reader) 16114 elif tag == 'start_time': 16115 obj.start_time = Reader.read_date(reader) 16116 elif tag == 'statistics': 16117 obj.statistics = StatisticReader.read_many(reader) 16118 elif tag == 'status': 16119 obj.status = Reader.read_enum(types.StepStatus, reader) 16120 elif tag == 'type': 16121 obj.type = Reader.read_enum(types.StepEnum, reader) 16122 elif tag == 'link': 16123 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16124 reader.next_element() 16125 else: 16126 reader.next_element() 16127 for link in links: 16128 StepReader._process_link(link, obj) 16129 16130 # Discard the end tag: 16131 reader.read() 16132 16133 return obj 16134 16135 @staticmethod 16136 def read_many(reader): 16137 # Do nothing if there aren't more tags: 16138 objs = List() 16139 if not reader.forward(): 16140 return objs 16141 16142 # Process the attributes: 16143 objs.href = reader.get_attribute('href') 16144 16145 # Discard the start tag: 16146 empty = reader.empty_element() 16147 reader.read() 16148 if empty: 16149 return objs 16150 16151 # Process the inner elements: 16152 while reader.forward(): 16153 objs.append(StepReader.read_one(reader)) 16154 16155 # Discard the end tag: 16156 reader.read() 16157 16158 return objs 16159 16160 @staticmethod 16161 def _process_link(link, obj): 16162 # Process the attributes: 16163 rel = link[0] 16164 href = link[1] 16165 if href and rel: 16166 if rel == "statistics": 16167 if obj.statistics is not None: 16168 obj.statistics.href = href 16169 else: 16170 obj.statistics = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16067 @staticmethod 16068 def read_one(reader): 16069 # Do nothing if there aren't more tags: 16070 if not reader.forward(): 16071 return None 16072 16073 # Create the object: 16074 obj = types.Step() 16075 16076 # Process the attributes: 16077 obj.href = reader.get_attribute('href') 16078 value = reader.get_attribute('id') 16079 if value is not None: 16080 obj.id = value 16081 16082 # Discard the start tag: 16083 empty = reader.empty_element() 16084 reader.read() 16085 if empty: 16086 return obj 16087 16088 # Process the inner elements: 16089 links = [] 16090 while reader.forward(): 16091 tag = reader.node_name() 16092 if tag == 'comment': 16093 obj.comment = Reader.read_string(reader) 16094 elif tag == 'description': 16095 obj.description = Reader.read_string(reader) 16096 elif tag == 'end_time': 16097 obj.end_time = Reader.read_date(reader) 16098 elif tag == 'execution_host': 16099 obj.execution_host = HostReader.read_one(reader) 16100 elif tag == 'external': 16101 obj.external = Reader.read_boolean(reader) 16102 elif tag == 'external_type': 16103 obj.external_type = Reader.read_enum(types.ExternalSystemType, reader) 16104 elif tag == 'job': 16105 obj.job = JobReader.read_one(reader) 16106 elif tag == 'name': 16107 obj.name = Reader.read_string(reader) 16108 elif tag == 'number': 16109 obj.number = Reader.read_integer(reader) 16110 elif tag == 'parent_step': 16111 obj.parent_step = StepReader.read_one(reader) 16112 elif tag == 'progress': 16113 obj.progress = Reader.read_integer(reader) 16114 elif tag == 'start_time': 16115 obj.start_time = Reader.read_date(reader) 16116 elif tag == 'statistics': 16117 obj.statistics = StatisticReader.read_many(reader) 16118 elif tag == 'status': 16119 obj.status = Reader.read_enum(types.StepStatus, reader) 16120 elif tag == 'type': 16121 obj.type = Reader.read_enum(types.StepEnum, reader) 16122 elif tag == 'link': 16123 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16124 reader.next_element() 16125 else: 16126 reader.next_element() 16127 for link in links: 16128 StepReader._process_link(link, obj) 16129 16130 # Discard the end tag: 16131 reader.read() 16132 16133 return obj
16135 @staticmethod 16136 def read_many(reader): 16137 # Do nothing if there aren't more tags: 16138 objs = List() 16139 if not reader.forward(): 16140 return objs 16141 16142 # Process the attributes: 16143 objs.href = reader.get_attribute('href') 16144 16145 # Discard the start tag: 16146 empty = reader.empty_element() 16147 reader.read() 16148 if empty: 16149 return objs 16150 16151 # Process the inner elements: 16152 while reader.forward(): 16153 objs.append(StepReader.read_one(reader)) 16154 16155 # Discard the end tag: 16156 reader.read() 16157 16158 return objs
16173class StorageConnectionReader(Reader): 16174 16175 def __init__(self): 16176 super(StorageConnectionReader, self).__init__() 16177 16178 @staticmethod 16179 def read_one(reader): 16180 # Do nothing if there aren't more tags: 16181 if not reader.forward(): 16182 return None 16183 16184 # Create the object: 16185 obj = types.StorageConnection() 16186 16187 # Process the attributes: 16188 obj.href = reader.get_attribute('href') 16189 value = reader.get_attribute('id') 16190 if value is not None: 16191 obj.id = value 16192 16193 # Discard the start tag: 16194 empty = reader.empty_element() 16195 reader.read() 16196 if empty: 16197 return obj 16198 16199 # Process the inner elements: 16200 links = [] 16201 while reader.forward(): 16202 tag = reader.node_name() 16203 if tag == 'address': 16204 obj.address = Reader.read_string(reader) 16205 elif tag == 'comment': 16206 obj.comment = Reader.read_string(reader) 16207 elif tag == 'description': 16208 obj.description = Reader.read_string(reader) 16209 elif tag == 'gluster_volume': 16210 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16211 elif tag == 'host': 16212 obj.host = HostReader.read_one(reader) 16213 elif tag == 'mount_options': 16214 obj.mount_options = Reader.read_string(reader) 16215 elif tag == 'name': 16216 obj.name = Reader.read_string(reader) 16217 elif tag == 'nfs_retrans': 16218 obj.nfs_retrans = Reader.read_integer(reader) 16219 elif tag == 'nfs_timeo': 16220 obj.nfs_timeo = Reader.read_integer(reader) 16221 elif tag == 'nfs_version': 16222 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 16223 elif tag == 'password': 16224 obj.password = Reader.read_string(reader) 16225 elif tag == 'path': 16226 obj.path = Reader.read_string(reader) 16227 elif tag == 'port': 16228 obj.port = Reader.read_integer(reader) 16229 elif tag == 'portal': 16230 obj.portal = Reader.read_string(reader) 16231 elif tag == 'target': 16232 obj.target = Reader.read_string(reader) 16233 elif tag == 'type': 16234 obj.type = Reader.read_enum(types.StorageType, reader) 16235 elif tag == 'username': 16236 obj.username = Reader.read_string(reader) 16237 elif tag == 'vfs_type': 16238 obj.vfs_type = Reader.read_string(reader) 16239 else: 16240 reader.next_element() 16241 for link in links: 16242 StorageConnectionReader._process_link(link, obj) 16243 16244 # Discard the end tag: 16245 reader.read() 16246 16247 return obj 16248 16249 @staticmethod 16250 def read_many(reader): 16251 # Do nothing if there aren't more tags: 16252 objs = List() 16253 if not reader.forward(): 16254 return objs 16255 16256 # Process the attributes: 16257 objs.href = reader.get_attribute('href') 16258 16259 # Discard the start tag: 16260 empty = reader.empty_element() 16261 reader.read() 16262 if empty: 16263 return objs 16264 16265 # Process the inner elements: 16266 while reader.forward(): 16267 objs.append(StorageConnectionReader.read_one(reader)) 16268 16269 # Discard the end tag: 16270 reader.read() 16271 16272 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16178 @staticmethod 16179 def read_one(reader): 16180 # Do nothing if there aren't more tags: 16181 if not reader.forward(): 16182 return None 16183 16184 # Create the object: 16185 obj = types.StorageConnection() 16186 16187 # Process the attributes: 16188 obj.href = reader.get_attribute('href') 16189 value = reader.get_attribute('id') 16190 if value is not None: 16191 obj.id = value 16192 16193 # Discard the start tag: 16194 empty = reader.empty_element() 16195 reader.read() 16196 if empty: 16197 return obj 16198 16199 # Process the inner elements: 16200 links = [] 16201 while reader.forward(): 16202 tag = reader.node_name() 16203 if tag == 'address': 16204 obj.address = Reader.read_string(reader) 16205 elif tag == 'comment': 16206 obj.comment = Reader.read_string(reader) 16207 elif tag == 'description': 16208 obj.description = Reader.read_string(reader) 16209 elif tag == 'gluster_volume': 16210 obj.gluster_volume = GlusterVolumeReader.read_one(reader) 16211 elif tag == 'host': 16212 obj.host = HostReader.read_one(reader) 16213 elif tag == 'mount_options': 16214 obj.mount_options = Reader.read_string(reader) 16215 elif tag == 'name': 16216 obj.name = Reader.read_string(reader) 16217 elif tag == 'nfs_retrans': 16218 obj.nfs_retrans = Reader.read_integer(reader) 16219 elif tag == 'nfs_timeo': 16220 obj.nfs_timeo = Reader.read_integer(reader) 16221 elif tag == 'nfs_version': 16222 obj.nfs_version = Reader.read_enum(types.NfsVersion, reader) 16223 elif tag == 'password': 16224 obj.password = Reader.read_string(reader) 16225 elif tag == 'path': 16226 obj.path = Reader.read_string(reader) 16227 elif tag == 'port': 16228 obj.port = Reader.read_integer(reader) 16229 elif tag == 'portal': 16230 obj.portal = Reader.read_string(reader) 16231 elif tag == 'target': 16232 obj.target = Reader.read_string(reader) 16233 elif tag == 'type': 16234 obj.type = Reader.read_enum(types.StorageType, reader) 16235 elif tag == 'username': 16236 obj.username = Reader.read_string(reader) 16237 elif tag == 'vfs_type': 16238 obj.vfs_type = Reader.read_string(reader) 16239 else: 16240 reader.next_element() 16241 for link in links: 16242 StorageConnectionReader._process_link(link, obj) 16243 16244 # Discard the end tag: 16245 reader.read() 16246 16247 return obj
16249 @staticmethod 16250 def read_many(reader): 16251 # Do nothing if there aren't more tags: 16252 objs = List() 16253 if not reader.forward(): 16254 return objs 16255 16256 # Process the attributes: 16257 objs.href = reader.get_attribute('href') 16258 16259 # Discard the start tag: 16260 empty = reader.empty_element() 16261 reader.read() 16262 if empty: 16263 return objs 16264 16265 # Process the inner elements: 16266 while reader.forward(): 16267 objs.append(StorageConnectionReader.read_one(reader)) 16268 16269 # Discard the end tag: 16270 reader.read() 16271 16272 return objs
16275class StorageConnectionExtensionReader(Reader): 16276 16277 def __init__(self): 16278 super(StorageConnectionExtensionReader, self).__init__() 16279 16280 @staticmethod 16281 def read_one(reader): 16282 # Do nothing if there aren't more tags: 16283 if not reader.forward(): 16284 return None 16285 16286 # Create the object: 16287 obj = types.StorageConnectionExtension() 16288 16289 # Process the attributes: 16290 obj.href = reader.get_attribute('href') 16291 value = reader.get_attribute('id') 16292 if value is not None: 16293 obj.id = value 16294 16295 # Discard the start tag: 16296 empty = reader.empty_element() 16297 reader.read() 16298 if empty: 16299 return obj 16300 16301 # Process the inner elements: 16302 links = [] 16303 while reader.forward(): 16304 tag = reader.node_name() 16305 if tag == 'comment': 16306 obj.comment = Reader.read_string(reader) 16307 elif tag == 'description': 16308 obj.description = Reader.read_string(reader) 16309 elif tag == 'host': 16310 obj.host = HostReader.read_one(reader) 16311 elif tag == 'name': 16312 obj.name = Reader.read_string(reader) 16313 elif tag == 'password': 16314 obj.password = Reader.read_string(reader) 16315 elif tag == 'target': 16316 obj.target = Reader.read_string(reader) 16317 elif tag == 'username': 16318 obj.username = Reader.read_string(reader) 16319 else: 16320 reader.next_element() 16321 for link in links: 16322 StorageConnectionExtensionReader._process_link(link, obj) 16323 16324 # Discard the end tag: 16325 reader.read() 16326 16327 return obj 16328 16329 @staticmethod 16330 def read_many(reader): 16331 # Do nothing if there aren't more tags: 16332 objs = List() 16333 if not reader.forward(): 16334 return objs 16335 16336 # Process the attributes: 16337 objs.href = reader.get_attribute('href') 16338 16339 # Discard the start tag: 16340 empty = reader.empty_element() 16341 reader.read() 16342 if empty: 16343 return objs 16344 16345 # Process the inner elements: 16346 while reader.forward(): 16347 objs.append(StorageConnectionExtensionReader.read_one(reader)) 16348 16349 # Discard the end tag: 16350 reader.read() 16351 16352 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16280 @staticmethod 16281 def read_one(reader): 16282 # Do nothing if there aren't more tags: 16283 if not reader.forward(): 16284 return None 16285 16286 # Create the object: 16287 obj = types.StorageConnectionExtension() 16288 16289 # Process the attributes: 16290 obj.href = reader.get_attribute('href') 16291 value = reader.get_attribute('id') 16292 if value is not None: 16293 obj.id = value 16294 16295 # Discard the start tag: 16296 empty = reader.empty_element() 16297 reader.read() 16298 if empty: 16299 return obj 16300 16301 # Process the inner elements: 16302 links = [] 16303 while reader.forward(): 16304 tag = reader.node_name() 16305 if tag == 'comment': 16306 obj.comment = Reader.read_string(reader) 16307 elif tag == 'description': 16308 obj.description = Reader.read_string(reader) 16309 elif tag == 'host': 16310 obj.host = HostReader.read_one(reader) 16311 elif tag == 'name': 16312 obj.name = Reader.read_string(reader) 16313 elif tag == 'password': 16314 obj.password = Reader.read_string(reader) 16315 elif tag == 'target': 16316 obj.target = Reader.read_string(reader) 16317 elif tag == 'username': 16318 obj.username = Reader.read_string(reader) 16319 else: 16320 reader.next_element() 16321 for link in links: 16322 StorageConnectionExtensionReader._process_link(link, obj) 16323 16324 # Discard the end tag: 16325 reader.read() 16326 16327 return obj
16329 @staticmethod 16330 def read_many(reader): 16331 # Do nothing if there aren't more tags: 16332 objs = List() 16333 if not reader.forward(): 16334 return objs 16335 16336 # Process the attributes: 16337 objs.href = reader.get_attribute('href') 16338 16339 # Discard the start tag: 16340 empty = reader.empty_element() 16341 reader.read() 16342 if empty: 16343 return objs 16344 16345 # Process the inner elements: 16346 while reader.forward(): 16347 objs.append(StorageConnectionExtensionReader.read_one(reader)) 16348 16349 # Discard the end tag: 16350 reader.read() 16351 16352 return objs
16355class StorageDomainReader(Reader): 16356 16357 def __init__(self): 16358 super(StorageDomainReader, self).__init__() 16359 16360 @staticmethod 16361 def read_one(reader): 16362 # Do nothing if there aren't more tags: 16363 if not reader.forward(): 16364 return None 16365 16366 # Create the object: 16367 obj = types.StorageDomain() 16368 16369 # Process the attributes: 16370 obj.href = reader.get_attribute('href') 16371 value = reader.get_attribute('id') 16372 if value is not None: 16373 obj.id = value 16374 16375 # Discard the start tag: 16376 empty = reader.empty_element() 16377 reader.read() 16378 if empty: 16379 return obj 16380 16381 # Process the inner elements: 16382 links = [] 16383 while reader.forward(): 16384 tag = reader.node_name() 16385 if tag == 'available': 16386 obj.available = Reader.read_integer(reader) 16387 elif tag == 'backup': 16388 obj.backup = Reader.read_boolean(reader) 16389 elif tag == 'block_size': 16390 obj.block_size = Reader.read_integer(reader) 16391 elif tag == 'comment': 16392 obj.comment = Reader.read_string(reader) 16393 elif tag == 'committed': 16394 obj.committed = Reader.read_integer(reader) 16395 elif tag == 'critical_space_action_blocker': 16396 obj.critical_space_action_blocker = Reader.read_integer(reader) 16397 elif tag == 'data_center': 16398 obj.data_center = DataCenterReader.read_one(reader) 16399 elif tag == 'data_centers': 16400 obj.data_centers = DataCenterReader.read_many(reader) 16401 elif tag == 'description': 16402 obj.description = Reader.read_string(reader) 16403 elif tag == 'discard_after_delete': 16404 obj.discard_after_delete = Reader.read_boolean(reader) 16405 elif tag == 'disk_profiles': 16406 obj.disk_profiles = DiskProfileReader.read_many(reader) 16407 elif tag == 'disk_snapshots': 16408 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 16409 elif tag == 'disks': 16410 obj.disks = DiskReader.read_many(reader) 16411 elif tag == 'external_status': 16412 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 16413 elif tag == 'files': 16414 obj.files = FileReader.read_many(reader) 16415 elif tag == 'host': 16416 obj.host = HostReader.read_one(reader) 16417 elif tag == 'images': 16418 obj.images = ImageReader.read_many(reader) 16419 elif tag == 'import': 16420 obj.import_ = Reader.read_boolean(reader) 16421 elif tag == 'master': 16422 obj.master = Reader.read_boolean(reader) 16423 elif tag == 'name': 16424 obj.name = Reader.read_string(reader) 16425 elif tag == 'permissions': 16426 obj.permissions = PermissionReader.read_many(reader) 16427 elif tag == 'status': 16428 obj.status = Reader.read_enum(types.StorageDomainStatus, reader) 16429 elif tag == 'storage': 16430 obj.storage = HostStorageReader.read_one(reader) 16431 elif tag == 'storage_connections': 16432 obj.storage_connections = StorageConnectionReader.read_many(reader) 16433 elif tag == 'storage_format': 16434 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 16435 elif tag == 'supports_discard': 16436 obj.supports_discard = Reader.read_boolean(reader) 16437 elif tag == 'supports_discard_zeroes_data': 16438 obj.supports_discard_zeroes_data = Reader.read_boolean(reader) 16439 elif tag == 'templates': 16440 obj.templates = TemplateReader.read_many(reader) 16441 elif tag == 'type': 16442 obj.type = Reader.read_enum(types.StorageDomainType, reader) 16443 elif tag == 'used': 16444 obj.used = Reader.read_integer(reader) 16445 elif tag == 'vms': 16446 obj.vms = VmReader.read_many(reader) 16447 elif tag == 'warning_low_space_indicator': 16448 obj.warning_low_space_indicator = Reader.read_integer(reader) 16449 elif tag == 'wipe_after_delete': 16450 obj.wipe_after_delete = Reader.read_boolean(reader) 16451 elif tag == 'link': 16452 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16453 reader.next_element() 16454 else: 16455 reader.next_element() 16456 for link in links: 16457 StorageDomainReader._process_link(link, obj) 16458 16459 # Discard the end tag: 16460 reader.read() 16461 16462 return obj 16463 16464 @staticmethod 16465 def read_many(reader): 16466 # Do nothing if there aren't more tags: 16467 objs = List() 16468 if not reader.forward(): 16469 return objs 16470 16471 # Process the attributes: 16472 objs.href = reader.get_attribute('href') 16473 16474 # Discard the start tag: 16475 empty = reader.empty_element() 16476 reader.read() 16477 if empty: 16478 return objs 16479 16480 # Process the inner elements: 16481 while reader.forward(): 16482 objs.append(StorageDomainReader.read_one(reader)) 16483 16484 # Discard the end tag: 16485 reader.read() 16486 16487 return objs 16488 16489 @staticmethod 16490 def _process_link(link, obj): 16491 # Process the attributes: 16492 rel = link[0] 16493 href = link[1] 16494 if href and rel: 16495 if rel == "datacenters": 16496 if obj.data_centers is not None: 16497 obj.data_centers.href = href 16498 else: 16499 obj.data_centers = List(href) 16500 elif rel == "diskprofiles": 16501 if obj.disk_profiles is not None: 16502 obj.disk_profiles.href = href 16503 else: 16504 obj.disk_profiles = List(href) 16505 elif rel == "disksnapshots": 16506 if obj.disk_snapshots is not None: 16507 obj.disk_snapshots.href = href 16508 else: 16509 obj.disk_snapshots = List(href) 16510 elif rel == "disks": 16511 if obj.disks is not None: 16512 obj.disks.href = href 16513 else: 16514 obj.disks = List(href) 16515 elif rel == "files": 16516 if obj.files is not None: 16517 obj.files.href = href 16518 else: 16519 obj.files = List(href) 16520 elif rel == "images": 16521 if obj.images is not None: 16522 obj.images.href = href 16523 else: 16524 obj.images = List(href) 16525 elif rel == "permissions": 16526 if obj.permissions is not None: 16527 obj.permissions.href = href 16528 else: 16529 obj.permissions = List(href) 16530 elif rel == "storageconnections": 16531 if obj.storage_connections is not None: 16532 obj.storage_connections.href = href 16533 else: 16534 obj.storage_connections = List(href) 16535 elif rel == "templates": 16536 if obj.templates is not None: 16537 obj.templates.href = href 16538 else: 16539 obj.templates = List(href) 16540 elif rel == "vms": 16541 if obj.vms is not None: 16542 obj.vms.href = href 16543 else: 16544 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16360 @staticmethod 16361 def read_one(reader): 16362 # Do nothing if there aren't more tags: 16363 if not reader.forward(): 16364 return None 16365 16366 # Create the object: 16367 obj = types.StorageDomain() 16368 16369 # Process the attributes: 16370 obj.href = reader.get_attribute('href') 16371 value = reader.get_attribute('id') 16372 if value is not None: 16373 obj.id = value 16374 16375 # Discard the start tag: 16376 empty = reader.empty_element() 16377 reader.read() 16378 if empty: 16379 return obj 16380 16381 # Process the inner elements: 16382 links = [] 16383 while reader.forward(): 16384 tag = reader.node_name() 16385 if tag == 'available': 16386 obj.available = Reader.read_integer(reader) 16387 elif tag == 'backup': 16388 obj.backup = Reader.read_boolean(reader) 16389 elif tag == 'block_size': 16390 obj.block_size = Reader.read_integer(reader) 16391 elif tag == 'comment': 16392 obj.comment = Reader.read_string(reader) 16393 elif tag == 'committed': 16394 obj.committed = Reader.read_integer(reader) 16395 elif tag == 'critical_space_action_blocker': 16396 obj.critical_space_action_blocker = Reader.read_integer(reader) 16397 elif tag == 'data_center': 16398 obj.data_center = DataCenterReader.read_one(reader) 16399 elif tag == 'data_centers': 16400 obj.data_centers = DataCenterReader.read_many(reader) 16401 elif tag == 'description': 16402 obj.description = Reader.read_string(reader) 16403 elif tag == 'discard_after_delete': 16404 obj.discard_after_delete = Reader.read_boolean(reader) 16405 elif tag == 'disk_profiles': 16406 obj.disk_profiles = DiskProfileReader.read_many(reader) 16407 elif tag == 'disk_snapshots': 16408 obj.disk_snapshots = DiskSnapshotReader.read_many(reader) 16409 elif tag == 'disks': 16410 obj.disks = DiskReader.read_many(reader) 16411 elif tag == 'external_status': 16412 obj.external_status = Reader.read_enum(types.ExternalStatus, reader) 16413 elif tag == 'files': 16414 obj.files = FileReader.read_many(reader) 16415 elif tag == 'host': 16416 obj.host = HostReader.read_one(reader) 16417 elif tag == 'images': 16418 obj.images = ImageReader.read_many(reader) 16419 elif tag == 'import': 16420 obj.import_ = Reader.read_boolean(reader) 16421 elif tag == 'master': 16422 obj.master = Reader.read_boolean(reader) 16423 elif tag == 'name': 16424 obj.name = Reader.read_string(reader) 16425 elif tag == 'permissions': 16426 obj.permissions = PermissionReader.read_many(reader) 16427 elif tag == 'status': 16428 obj.status = Reader.read_enum(types.StorageDomainStatus, reader) 16429 elif tag == 'storage': 16430 obj.storage = HostStorageReader.read_one(reader) 16431 elif tag == 'storage_connections': 16432 obj.storage_connections = StorageConnectionReader.read_many(reader) 16433 elif tag == 'storage_format': 16434 obj.storage_format = Reader.read_enum(types.StorageFormat, reader) 16435 elif tag == 'supports_discard': 16436 obj.supports_discard = Reader.read_boolean(reader) 16437 elif tag == 'supports_discard_zeroes_data': 16438 obj.supports_discard_zeroes_data = Reader.read_boolean(reader) 16439 elif tag == 'templates': 16440 obj.templates = TemplateReader.read_many(reader) 16441 elif tag == 'type': 16442 obj.type = Reader.read_enum(types.StorageDomainType, reader) 16443 elif tag == 'used': 16444 obj.used = Reader.read_integer(reader) 16445 elif tag == 'vms': 16446 obj.vms = VmReader.read_many(reader) 16447 elif tag == 'warning_low_space_indicator': 16448 obj.warning_low_space_indicator = Reader.read_integer(reader) 16449 elif tag == 'wipe_after_delete': 16450 obj.wipe_after_delete = Reader.read_boolean(reader) 16451 elif tag == 'link': 16452 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16453 reader.next_element() 16454 else: 16455 reader.next_element() 16456 for link in links: 16457 StorageDomainReader._process_link(link, obj) 16458 16459 # Discard the end tag: 16460 reader.read() 16461 16462 return obj
16464 @staticmethod 16465 def read_many(reader): 16466 # Do nothing if there aren't more tags: 16467 objs = List() 16468 if not reader.forward(): 16469 return objs 16470 16471 # Process the attributes: 16472 objs.href = reader.get_attribute('href') 16473 16474 # Discard the start tag: 16475 empty = reader.empty_element() 16476 reader.read() 16477 if empty: 16478 return objs 16479 16480 # Process the inner elements: 16481 while reader.forward(): 16482 objs.append(StorageDomainReader.read_one(reader)) 16483 16484 # Discard the end tag: 16485 reader.read() 16486 16487 return objs
16547class StorageDomainLeaseReader(Reader): 16548 16549 def __init__(self): 16550 super(StorageDomainLeaseReader, self).__init__() 16551 16552 @staticmethod 16553 def read_one(reader): 16554 # Do nothing if there aren't more tags: 16555 if not reader.forward(): 16556 return None 16557 16558 # Create the object: 16559 obj = types.StorageDomainLease() 16560 16561 # Process the attributes: 16562 obj.href = reader.get_attribute('href') 16563 16564 # Discard the start tag: 16565 empty = reader.empty_element() 16566 reader.read() 16567 if empty: 16568 return obj 16569 16570 # Process the inner elements: 16571 links = [] 16572 while reader.forward(): 16573 tag = reader.node_name() 16574 if tag == 'storage_domain': 16575 obj.storage_domain = StorageDomainReader.read_one(reader) 16576 else: 16577 reader.next_element() 16578 for link in links: 16579 StorageDomainLeaseReader._process_link(link, obj) 16580 16581 # Discard the end tag: 16582 reader.read() 16583 16584 return obj 16585 16586 @staticmethod 16587 def read_many(reader): 16588 # Do nothing if there aren't more tags: 16589 objs = List() 16590 if not reader.forward(): 16591 return objs 16592 16593 # Process the attributes: 16594 objs.href = reader.get_attribute('href') 16595 16596 # Discard the start tag: 16597 empty = reader.empty_element() 16598 reader.read() 16599 if empty: 16600 return objs 16601 16602 # Process the inner elements: 16603 while reader.forward(): 16604 objs.append(StorageDomainLeaseReader.read_one(reader)) 16605 16606 # Discard the end tag: 16607 reader.read() 16608 16609 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16552 @staticmethod 16553 def read_one(reader): 16554 # Do nothing if there aren't more tags: 16555 if not reader.forward(): 16556 return None 16557 16558 # Create the object: 16559 obj = types.StorageDomainLease() 16560 16561 # Process the attributes: 16562 obj.href = reader.get_attribute('href') 16563 16564 # Discard the start tag: 16565 empty = reader.empty_element() 16566 reader.read() 16567 if empty: 16568 return obj 16569 16570 # Process the inner elements: 16571 links = [] 16572 while reader.forward(): 16573 tag = reader.node_name() 16574 if tag == 'storage_domain': 16575 obj.storage_domain = StorageDomainReader.read_one(reader) 16576 else: 16577 reader.next_element() 16578 for link in links: 16579 StorageDomainLeaseReader._process_link(link, obj) 16580 16581 # Discard the end tag: 16582 reader.read() 16583 16584 return obj
16586 @staticmethod 16587 def read_many(reader): 16588 # Do nothing if there aren't more tags: 16589 objs = List() 16590 if not reader.forward(): 16591 return objs 16592 16593 # Process the attributes: 16594 objs.href = reader.get_attribute('href') 16595 16596 # Discard the start tag: 16597 empty = reader.empty_element() 16598 reader.read() 16599 if empty: 16600 return objs 16601 16602 # Process the inner elements: 16603 while reader.forward(): 16604 objs.append(StorageDomainLeaseReader.read_one(reader)) 16605 16606 # Discard the end tag: 16607 reader.read() 16608 16609 return objs
16612class SystemOptionReader(Reader): 16613 16614 def __init__(self): 16615 super(SystemOptionReader, self).__init__() 16616 16617 @staticmethod 16618 def read_one(reader): 16619 # Do nothing if there aren't more tags: 16620 if not reader.forward(): 16621 return None 16622 16623 # Create the object: 16624 obj = types.SystemOption() 16625 16626 # Process the attributes: 16627 obj.href = reader.get_attribute('href') 16628 value = reader.get_attribute('id') 16629 if value is not None: 16630 obj.id = value 16631 16632 # Discard the start tag: 16633 empty = reader.empty_element() 16634 reader.read() 16635 if empty: 16636 return obj 16637 16638 # Process the inner elements: 16639 links = [] 16640 while reader.forward(): 16641 tag = reader.node_name() 16642 if tag == 'comment': 16643 obj.comment = Reader.read_string(reader) 16644 elif tag == 'description': 16645 obj.description = Reader.read_string(reader) 16646 elif tag == 'name': 16647 obj.name = Reader.read_string(reader) 16648 elif tag == 'values': 16649 obj.values = SystemOptionValueReader.read_many(reader) 16650 else: 16651 reader.next_element() 16652 for link in links: 16653 SystemOptionReader._process_link(link, obj) 16654 16655 # Discard the end tag: 16656 reader.read() 16657 16658 return obj 16659 16660 @staticmethod 16661 def read_many(reader): 16662 # Do nothing if there aren't more tags: 16663 objs = List() 16664 if not reader.forward(): 16665 return objs 16666 16667 # Process the attributes: 16668 objs.href = reader.get_attribute('href') 16669 16670 # Discard the start tag: 16671 empty = reader.empty_element() 16672 reader.read() 16673 if empty: 16674 return objs 16675 16676 # Process the inner elements: 16677 while reader.forward(): 16678 objs.append(SystemOptionReader.read_one(reader)) 16679 16680 # Discard the end tag: 16681 reader.read() 16682 16683 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16617 @staticmethod 16618 def read_one(reader): 16619 # Do nothing if there aren't more tags: 16620 if not reader.forward(): 16621 return None 16622 16623 # Create the object: 16624 obj = types.SystemOption() 16625 16626 # Process the attributes: 16627 obj.href = reader.get_attribute('href') 16628 value = reader.get_attribute('id') 16629 if value is not None: 16630 obj.id = value 16631 16632 # Discard the start tag: 16633 empty = reader.empty_element() 16634 reader.read() 16635 if empty: 16636 return obj 16637 16638 # Process the inner elements: 16639 links = [] 16640 while reader.forward(): 16641 tag = reader.node_name() 16642 if tag == 'comment': 16643 obj.comment = Reader.read_string(reader) 16644 elif tag == 'description': 16645 obj.description = Reader.read_string(reader) 16646 elif tag == 'name': 16647 obj.name = Reader.read_string(reader) 16648 elif tag == 'values': 16649 obj.values = SystemOptionValueReader.read_many(reader) 16650 else: 16651 reader.next_element() 16652 for link in links: 16653 SystemOptionReader._process_link(link, obj) 16654 16655 # Discard the end tag: 16656 reader.read() 16657 16658 return obj
16660 @staticmethod 16661 def read_many(reader): 16662 # Do nothing if there aren't more tags: 16663 objs = List() 16664 if not reader.forward(): 16665 return objs 16666 16667 # Process the attributes: 16668 objs.href = reader.get_attribute('href') 16669 16670 # Discard the start tag: 16671 empty = reader.empty_element() 16672 reader.read() 16673 if empty: 16674 return objs 16675 16676 # Process the inner elements: 16677 while reader.forward(): 16678 objs.append(SystemOptionReader.read_one(reader)) 16679 16680 # Discard the end tag: 16681 reader.read() 16682 16683 return objs
16686class SystemOptionValueReader(Reader): 16687 16688 def __init__(self): 16689 super(SystemOptionValueReader, self).__init__() 16690 16691 @staticmethod 16692 def read_one(reader): 16693 # Do nothing if there aren't more tags: 16694 if not reader.forward(): 16695 return None 16696 16697 # Create the object: 16698 obj = types.SystemOptionValue() 16699 16700 # Process the attributes: 16701 obj.href = reader.get_attribute('href') 16702 16703 # Discard the start tag: 16704 empty = reader.empty_element() 16705 reader.read() 16706 if empty: 16707 return obj 16708 16709 # Process the inner elements: 16710 links = [] 16711 while reader.forward(): 16712 tag = reader.node_name() 16713 if tag == 'value': 16714 obj.value = Reader.read_string(reader) 16715 elif tag == 'version': 16716 obj.version = Reader.read_string(reader) 16717 else: 16718 reader.next_element() 16719 for link in links: 16720 SystemOptionValueReader._process_link(link, obj) 16721 16722 # Discard the end tag: 16723 reader.read() 16724 16725 return obj 16726 16727 @staticmethod 16728 def read_many(reader): 16729 # Do nothing if there aren't more tags: 16730 objs = List() 16731 if not reader.forward(): 16732 return objs 16733 16734 # Process the attributes: 16735 objs.href = reader.get_attribute('href') 16736 16737 # Discard the start tag: 16738 empty = reader.empty_element() 16739 reader.read() 16740 if empty: 16741 return objs 16742 16743 # Process the inner elements: 16744 while reader.forward(): 16745 objs.append(SystemOptionValueReader.read_one(reader)) 16746 16747 # Discard the end tag: 16748 reader.read() 16749 16750 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16691 @staticmethod 16692 def read_one(reader): 16693 # Do nothing if there aren't more tags: 16694 if not reader.forward(): 16695 return None 16696 16697 # Create the object: 16698 obj = types.SystemOptionValue() 16699 16700 # Process the attributes: 16701 obj.href = reader.get_attribute('href') 16702 16703 # Discard the start tag: 16704 empty = reader.empty_element() 16705 reader.read() 16706 if empty: 16707 return obj 16708 16709 # Process the inner elements: 16710 links = [] 16711 while reader.forward(): 16712 tag = reader.node_name() 16713 if tag == 'value': 16714 obj.value = Reader.read_string(reader) 16715 elif tag == 'version': 16716 obj.version = Reader.read_string(reader) 16717 else: 16718 reader.next_element() 16719 for link in links: 16720 SystemOptionValueReader._process_link(link, obj) 16721 16722 # Discard the end tag: 16723 reader.read() 16724 16725 return obj
16727 @staticmethod 16728 def read_many(reader): 16729 # Do nothing if there aren't more tags: 16730 objs = List() 16731 if not reader.forward(): 16732 return objs 16733 16734 # Process the attributes: 16735 objs.href = reader.get_attribute('href') 16736 16737 # Discard the start tag: 16738 empty = reader.empty_element() 16739 reader.read() 16740 if empty: 16741 return objs 16742 16743 # Process the inner elements: 16744 while reader.forward(): 16745 objs.append(SystemOptionValueReader.read_one(reader)) 16746 16747 # Discard the end tag: 16748 reader.read() 16749 16750 return objs
16753class TagReader(Reader): 16754 16755 def __init__(self): 16756 super(TagReader, self).__init__() 16757 16758 @staticmethod 16759 def read_one(reader): 16760 # Do nothing if there aren't more tags: 16761 if not reader.forward(): 16762 return None 16763 16764 # Create the object: 16765 obj = types.Tag() 16766 16767 # Process the attributes: 16768 obj.href = reader.get_attribute('href') 16769 value = reader.get_attribute('id') 16770 if value is not None: 16771 obj.id = value 16772 16773 # Discard the start tag: 16774 empty = reader.empty_element() 16775 reader.read() 16776 if empty: 16777 return obj 16778 16779 # Process the inner elements: 16780 links = [] 16781 while reader.forward(): 16782 tag = reader.node_name() 16783 if tag == 'comment': 16784 obj.comment = Reader.read_string(reader) 16785 elif tag == 'description': 16786 obj.description = Reader.read_string(reader) 16787 elif tag == 'group': 16788 obj.group = GroupReader.read_one(reader) 16789 elif tag == 'host': 16790 obj.host = HostReader.read_one(reader) 16791 elif tag == 'name': 16792 obj.name = Reader.read_string(reader) 16793 elif tag == 'parent': 16794 obj.parent = TagReader.read_one(reader) 16795 elif tag == 'template': 16796 obj.template = TemplateReader.read_one(reader) 16797 elif tag == 'user': 16798 obj.user = UserReader.read_one(reader) 16799 elif tag == 'vm': 16800 obj.vm = VmReader.read_one(reader) 16801 else: 16802 reader.next_element() 16803 for link in links: 16804 TagReader._process_link(link, obj) 16805 16806 # Discard the end tag: 16807 reader.read() 16808 16809 return obj 16810 16811 @staticmethod 16812 def read_many(reader): 16813 # Do nothing if there aren't more tags: 16814 objs = List() 16815 if not reader.forward(): 16816 return objs 16817 16818 # Process the attributes: 16819 objs.href = reader.get_attribute('href') 16820 16821 # Discard the start tag: 16822 empty = reader.empty_element() 16823 reader.read() 16824 if empty: 16825 return objs 16826 16827 # Process the inner elements: 16828 while reader.forward(): 16829 objs.append(TagReader.read_one(reader)) 16830 16831 # Discard the end tag: 16832 reader.read() 16833 16834 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16758 @staticmethod 16759 def read_one(reader): 16760 # Do nothing if there aren't more tags: 16761 if not reader.forward(): 16762 return None 16763 16764 # Create the object: 16765 obj = types.Tag() 16766 16767 # Process the attributes: 16768 obj.href = reader.get_attribute('href') 16769 value = reader.get_attribute('id') 16770 if value is not None: 16771 obj.id = value 16772 16773 # Discard the start tag: 16774 empty = reader.empty_element() 16775 reader.read() 16776 if empty: 16777 return obj 16778 16779 # Process the inner elements: 16780 links = [] 16781 while reader.forward(): 16782 tag = reader.node_name() 16783 if tag == 'comment': 16784 obj.comment = Reader.read_string(reader) 16785 elif tag == 'description': 16786 obj.description = Reader.read_string(reader) 16787 elif tag == 'group': 16788 obj.group = GroupReader.read_one(reader) 16789 elif tag == 'host': 16790 obj.host = HostReader.read_one(reader) 16791 elif tag == 'name': 16792 obj.name = Reader.read_string(reader) 16793 elif tag == 'parent': 16794 obj.parent = TagReader.read_one(reader) 16795 elif tag == 'template': 16796 obj.template = TemplateReader.read_one(reader) 16797 elif tag == 'user': 16798 obj.user = UserReader.read_one(reader) 16799 elif tag == 'vm': 16800 obj.vm = VmReader.read_one(reader) 16801 else: 16802 reader.next_element() 16803 for link in links: 16804 TagReader._process_link(link, obj) 16805 16806 # Discard the end tag: 16807 reader.read() 16808 16809 return obj
16811 @staticmethod 16812 def read_many(reader): 16813 # Do nothing if there aren't more tags: 16814 objs = List() 16815 if not reader.forward(): 16816 return objs 16817 16818 # Process the attributes: 16819 objs.href = reader.get_attribute('href') 16820 16821 # Discard the start tag: 16822 empty = reader.empty_element() 16823 reader.read() 16824 if empty: 16825 return objs 16826 16827 # Process the inner elements: 16828 while reader.forward(): 16829 objs.append(TagReader.read_one(reader)) 16830 16831 # Discard the end tag: 16832 reader.read() 16833 16834 return objs
16837class TemplateReader(Reader): 16838 16839 def __init__(self): 16840 super(TemplateReader, self).__init__() 16841 16842 @staticmethod 16843 def read_one(reader): 16844 # Do nothing if there aren't more tags: 16845 if not reader.forward(): 16846 return None 16847 16848 # Create the object: 16849 obj = types.Template() 16850 16851 # Process the attributes: 16852 obj.href = reader.get_attribute('href') 16853 value = reader.get_attribute('id') 16854 if value is not None: 16855 obj.id = value 16856 16857 # Discard the start tag: 16858 empty = reader.empty_element() 16859 reader.read() 16860 if empty: 16861 return obj 16862 16863 # Process the inner elements: 16864 links = [] 16865 while reader.forward(): 16866 tag = reader.node_name() 16867 if tag == 'auto_pinning_policy': 16868 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 16869 elif tag == 'bios': 16870 obj.bios = BiosReader.read_one(reader) 16871 elif tag == 'cdroms': 16872 obj.cdroms = CdromReader.read_many(reader) 16873 elif tag == 'cluster': 16874 obj.cluster = ClusterReader.read_one(reader) 16875 elif tag == 'comment': 16876 obj.comment = Reader.read_string(reader) 16877 elif tag == 'console': 16878 obj.console = ConsoleReader.read_one(reader) 16879 elif tag == 'cpu': 16880 obj.cpu = CpuReader.read_one(reader) 16881 elif tag == 'cpu_pinning_policy': 16882 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 16883 elif tag == 'cpu_profile': 16884 obj.cpu_profile = CpuProfileReader.read_one(reader) 16885 elif tag == 'cpu_shares': 16886 obj.cpu_shares = Reader.read_integer(reader) 16887 elif tag == 'creation_time': 16888 obj.creation_time = Reader.read_date(reader) 16889 elif tag == 'custom_compatibility_version': 16890 obj.custom_compatibility_version = VersionReader.read_one(reader) 16891 elif tag == 'custom_cpu_model': 16892 obj.custom_cpu_model = Reader.read_string(reader) 16893 elif tag == 'custom_emulated_machine': 16894 obj.custom_emulated_machine = Reader.read_string(reader) 16895 elif tag == 'custom_properties': 16896 obj.custom_properties = CustomPropertyReader.read_many(reader) 16897 elif tag == 'delete_protected': 16898 obj.delete_protected = Reader.read_boolean(reader) 16899 elif tag == 'description': 16900 obj.description = Reader.read_string(reader) 16901 elif tag == 'disk_attachments': 16902 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 16903 elif tag == 'display': 16904 obj.display = DisplayReader.read_one(reader) 16905 elif tag == 'domain': 16906 obj.domain = DomainReader.read_one(reader) 16907 elif tag == 'graphics_consoles': 16908 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 16909 elif tag == 'high_availability': 16910 obj.high_availability = HighAvailabilityReader.read_one(reader) 16911 elif tag == 'initialization': 16912 obj.initialization = InitializationReader.read_one(reader) 16913 elif tag == 'io': 16914 obj.io = IoReader.read_one(reader) 16915 elif tag == 'large_icon': 16916 obj.large_icon = IconReader.read_one(reader) 16917 elif tag == 'lease': 16918 obj.lease = StorageDomainLeaseReader.read_one(reader) 16919 elif tag == 'mediated_devices': 16920 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 16921 elif tag == 'memory': 16922 obj.memory = Reader.read_integer(reader) 16923 elif tag == 'memory_policy': 16924 obj.memory_policy = MemoryPolicyReader.read_one(reader) 16925 elif tag == 'migration': 16926 obj.migration = MigrationOptionsReader.read_one(reader) 16927 elif tag == 'migration_downtime': 16928 obj.migration_downtime = Reader.read_integer(reader) 16929 elif tag == 'multi_queues_enabled': 16930 obj.multi_queues_enabled = Reader.read_boolean(reader) 16931 elif tag == 'name': 16932 obj.name = Reader.read_string(reader) 16933 elif tag == 'nics': 16934 obj.nics = NicReader.read_many(reader) 16935 elif tag == 'origin': 16936 obj.origin = Reader.read_string(reader) 16937 elif tag == 'os': 16938 obj.os = OperatingSystemReader.read_one(reader) 16939 elif tag == 'permissions': 16940 obj.permissions = PermissionReader.read_many(reader) 16941 elif tag == 'placement_policy': 16942 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 16943 elif tag == 'quota': 16944 obj.quota = QuotaReader.read_one(reader) 16945 elif tag == 'rng_device': 16946 obj.rng_device = RngDeviceReader.read_one(reader) 16947 elif tag == 'serial_number': 16948 obj.serial_number = SerialNumberReader.read_one(reader) 16949 elif tag == 'small_icon': 16950 obj.small_icon = IconReader.read_one(reader) 16951 elif tag == 'soundcard_enabled': 16952 obj.soundcard_enabled = Reader.read_boolean(reader) 16953 elif tag == 'sso': 16954 obj.sso = SsoReader.read_one(reader) 16955 elif tag == 'start_paused': 16956 obj.start_paused = Reader.read_boolean(reader) 16957 elif tag == 'stateless': 16958 obj.stateless = Reader.read_boolean(reader) 16959 elif tag == 'status': 16960 obj.status = Reader.read_enum(types.TemplateStatus, reader) 16961 elif tag == 'storage_domain': 16962 obj.storage_domain = StorageDomainReader.read_one(reader) 16963 elif tag == 'storage_error_resume_behaviour': 16964 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 16965 elif tag == 'tags': 16966 obj.tags = TagReader.read_many(reader) 16967 elif tag == 'time_zone': 16968 obj.time_zone = TimeZoneReader.read_one(reader) 16969 elif tag == 'tpm_enabled': 16970 obj.tpm_enabled = Reader.read_boolean(reader) 16971 elif tag == 'tunnel_migration': 16972 obj.tunnel_migration = Reader.read_boolean(reader) 16973 elif tag == 'type': 16974 obj.type = Reader.read_enum(types.VmType, reader) 16975 elif tag == 'usb': 16976 obj.usb = UsbReader.read_one(reader) 16977 elif tag == 'version': 16978 obj.version = TemplateVersionReader.read_one(reader) 16979 elif tag == 'virtio_scsi': 16980 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 16981 elif tag == 'virtio_scsi_multi_queues': 16982 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 16983 elif tag == 'virtio_scsi_multi_queues_enabled': 16984 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 16985 elif tag == 'vm': 16986 obj.vm = VmReader.read_one(reader) 16987 elif tag == 'watchdogs': 16988 obj.watchdogs = WatchdogReader.read_many(reader) 16989 elif tag == 'link': 16990 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16991 reader.next_element() 16992 else: 16993 reader.next_element() 16994 for link in links: 16995 TemplateReader._process_link(link, obj) 16996 16997 # Discard the end tag: 16998 reader.read() 16999 17000 return obj 17001 17002 @staticmethod 17003 def read_many(reader): 17004 # Do nothing if there aren't more tags: 17005 objs = List() 17006 if not reader.forward(): 17007 return objs 17008 17009 # Process the attributes: 17010 objs.href = reader.get_attribute('href') 17011 17012 # Discard the start tag: 17013 empty = reader.empty_element() 17014 reader.read() 17015 if empty: 17016 return objs 17017 17018 # Process the inner elements: 17019 while reader.forward(): 17020 objs.append(TemplateReader.read_one(reader)) 17021 17022 # Discard the end tag: 17023 reader.read() 17024 17025 return objs 17026 17027 @staticmethod 17028 def _process_link(link, obj): 17029 # Process the attributes: 17030 rel = link[0] 17031 href = link[1] 17032 if href and rel: 17033 if rel == "cdroms": 17034 if obj.cdroms is not None: 17035 obj.cdroms.href = href 17036 else: 17037 obj.cdroms = List(href) 17038 elif rel == "diskattachments": 17039 if obj.disk_attachments is not None: 17040 obj.disk_attachments.href = href 17041 else: 17042 obj.disk_attachments = List(href) 17043 elif rel == "graphicsconsoles": 17044 if obj.graphics_consoles is not None: 17045 obj.graphics_consoles.href = href 17046 else: 17047 obj.graphics_consoles = List(href) 17048 elif rel == "mediateddevices": 17049 if obj.mediated_devices is not None: 17050 obj.mediated_devices.href = href 17051 else: 17052 obj.mediated_devices = List(href) 17053 elif rel == "nics": 17054 if obj.nics is not None: 17055 obj.nics.href = href 17056 else: 17057 obj.nics = List(href) 17058 elif rel == "permissions": 17059 if obj.permissions is not None: 17060 obj.permissions.href = href 17061 else: 17062 obj.permissions = List(href) 17063 elif rel == "tags": 17064 if obj.tags is not None: 17065 obj.tags.href = href 17066 else: 17067 obj.tags = List(href) 17068 elif rel == "watchdogs": 17069 if obj.watchdogs is not None: 17070 obj.watchdogs.href = href 17071 else: 17072 obj.watchdogs = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
16842 @staticmethod 16843 def read_one(reader): 16844 # Do nothing if there aren't more tags: 16845 if not reader.forward(): 16846 return None 16847 16848 # Create the object: 16849 obj = types.Template() 16850 16851 # Process the attributes: 16852 obj.href = reader.get_attribute('href') 16853 value = reader.get_attribute('id') 16854 if value is not None: 16855 obj.id = value 16856 16857 # Discard the start tag: 16858 empty = reader.empty_element() 16859 reader.read() 16860 if empty: 16861 return obj 16862 16863 # Process the inner elements: 16864 links = [] 16865 while reader.forward(): 16866 tag = reader.node_name() 16867 if tag == 'auto_pinning_policy': 16868 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 16869 elif tag == 'bios': 16870 obj.bios = BiosReader.read_one(reader) 16871 elif tag == 'cdroms': 16872 obj.cdroms = CdromReader.read_many(reader) 16873 elif tag == 'cluster': 16874 obj.cluster = ClusterReader.read_one(reader) 16875 elif tag == 'comment': 16876 obj.comment = Reader.read_string(reader) 16877 elif tag == 'console': 16878 obj.console = ConsoleReader.read_one(reader) 16879 elif tag == 'cpu': 16880 obj.cpu = CpuReader.read_one(reader) 16881 elif tag == 'cpu_pinning_policy': 16882 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 16883 elif tag == 'cpu_profile': 16884 obj.cpu_profile = CpuProfileReader.read_one(reader) 16885 elif tag == 'cpu_shares': 16886 obj.cpu_shares = Reader.read_integer(reader) 16887 elif tag == 'creation_time': 16888 obj.creation_time = Reader.read_date(reader) 16889 elif tag == 'custom_compatibility_version': 16890 obj.custom_compatibility_version = VersionReader.read_one(reader) 16891 elif tag == 'custom_cpu_model': 16892 obj.custom_cpu_model = Reader.read_string(reader) 16893 elif tag == 'custom_emulated_machine': 16894 obj.custom_emulated_machine = Reader.read_string(reader) 16895 elif tag == 'custom_properties': 16896 obj.custom_properties = CustomPropertyReader.read_many(reader) 16897 elif tag == 'delete_protected': 16898 obj.delete_protected = Reader.read_boolean(reader) 16899 elif tag == 'description': 16900 obj.description = Reader.read_string(reader) 16901 elif tag == 'disk_attachments': 16902 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 16903 elif tag == 'display': 16904 obj.display = DisplayReader.read_one(reader) 16905 elif tag == 'domain': 16906 obj.domain = DomainReader.read_one(reader) 16907 elif tag == 'graphics_consoles': 16908 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 16909 elif tag == 'high_availability': 16910 obj.high_availability = HighAvailabilityReader.read_one(reader) 16911 elif tag == 'initialization': 16912 obj.initialization = InitializationReader.read_one(reader) 16913 elif tag == 'io': 16914 obj.io = IoReader.read_one(reader) 16915 elif tag == 'large_icon': 16916 obj.large_icon = IconReader.read_one(reader) 16917 elif tag == 'lease': 16918 obj.lease = StorageDomainLeaseReader.read_one(reader) 16919 elif tag == 'mediated_devices': 16920 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 16921 elif tag == 'memory': 16922 obj.memory = Reader.read_integer(reader) 16923 elif tag == 'memory_policy': 16924 obj.memory_policy = MemoryPolicyReader.read_one(reader) 16925 elif tag == 'migration': 16926 obj.migration = MigrationOptionsReader.read_one(reader) 16927 elif tag == 'migration_downtime': 16928 obj.migration_downtime = Reader.read_integer(reader) 16929 elif tag == 'multi_queues_enabled': 16930 obj.multi_queues_enabled = Reader.read_boolean(reader) 16931 elif tag == 'name': 16932 obj.name = Reader.read_string(reader) 16933 elif tag == 'nics': 16934 obj.nics = NicReader.read_many(reader) 16935 elif tag == 'origin': 16936 obj.origin = Reader.read_string(reader) 16937 elif tag == 'os': 16938 obj.os = OperatingSystemReader.read_one(reader) 16939 elif tag == 'permissions': 16940 obj.permissions = PermissionReader.read_many(reader) 16941 elif tag == 'placement_policy': 16942 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 16943 elif tag == 'quota': 16944 obj.quota = QuotaReader.read_one(reader) 16945 elif tag == 'rng_device': 16946 obj.rng_device = RngDeviceReader.read_one(reader) 16947 elif tag == 'serial_number': 16948 obj.serial_number = SerialNumberReader.read_one(reader) 16949 elif tag == 'small_icon': 16950 obj.small_icon = IconReader.read_one(reader) 16951 elif tag == 'soundcard_enabled': 16952 obj.soundcard_enabled = Reader.read_boolean(reader) 16953 elif tag == 'sso': 16954 obj.sso = SsoReader.read_one(reader) 16955 elif tag == 'start_paused': 16956 obj.start_paused = Reader.read_boolean(reader) 16957 elif tag == 'stateless': 16958 obj.stateless = Reader.read_boolean(reader) 16959 elif tag == 'status': 16960 obj.status = Reader.read_enum(types.TemplateStatus, reader) 16961 elif tag == 'storage_domain': 16962 obj.storage_domain = StorageDomainReader.read_one(reader) 16963 elif tag == 'storage_error_resume_behaviour': 16964 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 16965 elif tag == 'tags': 16966 obj.tags = TagReader.read_many(reader) 16967 elif tag == 'time_zone': 16968 obj.time_zone = TimeZoneReader.read_one(reader) 16969 elif tag == 'tpm_enabled': 16970 obj.tpm_enabled = Reader.read_boolean(reader) 16971 elif tag == 'tunnel_migration': 16972 obj.tunnel_migration = Reader.read_boolean(reader) 16973 elif tag == 'type': 16974 obj.type = Reader.read_enum(types.VmType, reader) 16975 elif tag == 'usb': 16976 obj.usb = UsbReader.read_one(reader) 16977 elif tag == 'version': 16978 obj.version = TemplateVersionReader.read_one(reader) 16979 elif tag == 'virtio_scsi': 16980 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 16981 elif tag == 'virtio_scsi_multi_queues': 16982 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 16983 elif tag == 'virtio_scsi_multi_queues_enabled': 16984 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 16985 elif tag == 'vm': 16986 obj.vm = VmReader.read_one(reader) 16987 elif tag == 'watchdogs': 16988 obj.watchdogs = WatchdogReader.read_many(reader) 16989 elif tag == 'link': 16990 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 16991 reader.next_element() 16992 else: 16993 reader.next_element() 16994 for link in links: 16995 TemplateReader._process_link(link, obj) 16996 16997 # Discard the end tag: 16998 reader.read() 16999 17000 return obj
17002 @staticmethod 17003 def read_many(reader): 17004 # Do nothing if there aren't more tags: 17005 objs = List() 17006 if not reader.forward(): 17007 return objs 17008 17009 # Process the attributes: 17010 objs.href = reader.get_attribute('href') 17011 17012 # Discard the start tag: 17013 empty = reader.empty_element() 17014 reader.read() 17015 if empty: 17016 return objs 17017 17018 # Process the inner elements: 17019 while reader.forward(): 17020 objs.append(TemplateReader.read_one(reader)) 17021 17022 # Discard the end tag: 17023 reader.read() 17024 17025 return objs
17075class TemplateVersionReader(Reader): 17076 17077 def __init__(self): 17078 super(TemplateVersionReader, self).__init__() 17079 17080 @staticmethod 17081 def read_one(reader): 17082 # Do nothing if there aren't more tags: 17083 if not reader.forward(): 17084 return None 17085 17086 # Create the object: 17087 obj = types.TemplateVersion() 17088 17089 # Process the attributes: 17090 obj.href = reader.get_attribute('href') 17091 17092 # Discard the start tag: 17093 empty = reader.empty_element() 17094 reader.read() 17095 if empty: 17096 return obj 17097 17098 # Process the inner elements: 17099 links = [] 17100 while reader.forward(): 17101 tag = reader.node_name() 17102 if tag == 'base_template': 17103 obj.base_template = TemplateReader.read_one(reader) 17104 elif tag == 'version_name': 17105 obj.version_name = Reader.read_string(reader) 17106 elif tag == 'version_number': 17107 obj.version_number = Reader.read_integer(reader) 17108 else: 17109 reader.next_element() 17110 for link in links: 17111 TemplateVersionReader._process_link(link, obj) 17112 17113 # Discard the end tag: 17114 reader.read() 17115 17116 return obj 17117 17118 @staticmethod 17119 def read_many(reader): 17120 # Do nothing if there aren't more tags: 17121 objs = List() 17122 if not reader.forward(): 17123 return objs 17124 17125 # Process the attributes: 17126 objs.href = reader.get_attribute('href') 17127 17128 # Discard the start tag: 17129 empty = reader.empty_element() 17130 reader.read() 17131 if empty: 17132 return objs 17133 17134 # Process the inner elements: 17135 while reader.forward(): 17136 objs.append(TemplateVersionReader.read_one(reader)) 17137 17138 # Discard the end tag: 17139 reader.read() 17140 17141 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17080 @staticmethod 17081 def read_one(reader): 17082 # Do nothing if there aren't more tags: 17083 if not reader.forward(): 17084 return None 17085 17086 # Create the object: 17087 obj = types.TemplateVersion() 17088 17089 # Process the attributes: 17090 obj.href = reader.get_attribute('href') 17091 17092 # Discard the start tag: 17093 empty = reader.empty_element() 17094 reader.read() 17095 if empty: 17096 return obj 17097 17098 # Process the inner elements: 17099 links = [] 17100 while reader.forward(): 17101 tag = reader.node_name() 17102 if tag == 'base_template': 17103 obj.base_template = TemplateReader.read_one(reader) 17104 elif tag == 'version_name': 17105 obj.version_name = Reader.read_string(reader) 17106 elif tag == 'version_number': 17107 obj.version_number = Reader.read_integer(reader) 17108 else: 17109 reader.next_element() 17110 for link in links: 17111 TemplateVersionReader._process_link(link, obj) 17112 17113 # Discard the end tag: 17114 reader.read() 17115 17116 return obj
17118 @staticmethod 17119 def read_many(reader): 17120 # Do nothing if there aren't more tags: 17121 objs = List() 17122 if not reader.forward(): 17123 return objs 17124 17125 # Process the attributes: 17126 objs.href = reader.get_attribute('href') 17127 17128 # Discard the start tag: 17129 empty = reader.empty_element() 17130 reader.read() 17131 if empty: 17132 return objs 17133 17134 # Process the inner elements: 17135 while reader.forward(): 17136 objs.append(TemplateVersionReader.read_one(reader)) 17137 17138 # Discard the end tag: 17139 reader.read() 17140 17141 return objs
17144class TicketReader(Reader): 17145 17146 def __init__(self): 17147 super(TicketReader, self).__init__() 17148 17149 @staticmethod 17150 def read_one(reader): 17151 # Do nothing if there aren't more tags: 17152 if not reader.forward(): 17153 return None 17154 17155 # Create the object: 17156 obj = types.Ticket() 17157 17158 # Process the attributes: 17159 obj.href = reader.get_attribute('href') 17160 17161 # Discard the start tag: 17162 empty = reader.empty_element() 17163 reader.read() 17164 if empty: 17165 return obj 17166 17167 # Process the inner elements: 17168 links = [] 17169 while reader.forward(): 17170 tag = reader.node_name() 17171 if tag == 'expiry': 17172 obj.expiry = Reader.read_integer(reader) 17173 elif tag == 'value': 17174 obj.value = Reader.read_string(reader) 17175 else: 17176 reader.next_element() 17177 for link in links: 17178 TicketReader._process_link(link, obj) 17179 17180 # Discard the end tag: 17181 reader.read() 17182 17183 return obj 17184 17185 @staticmethod 17186 def read_many(reader): 17187 # Do nothing if there aren't more tags: 17188 objs = List() 17189 if not reader.forward(): 17190 return objs 17191 17192 # Process the attributes: 17193 objs.href = reader.get_attribute('href') 17194 17195 # Discard the start tag: 17196 empty = reader.empty_element() 17197 reader.read() 17198 if empty: 17199 return objs 17200 17201 # Process the inner elements: 17202 while reader.forward(): 17203 objs.append(TicketReader.read_one(reader)) 17204 17205 # Discard the end tag: 17206 reader.read() 17207 17208 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17149 @staticmethod 17150 def read_one(reader): 17151 # Do nothing if there aren't more tags: 17152 if not reader.forward(): 17153 return None 17154 17155 # Create the object: 17156 obj = types.Ticket() 17157 17158 # Process the attributes: 17159 obj.href = reader.get_attribute('href') 17160 17161 # Discard the start tag: 17162 empty = reader.empty_element() 17163 reader.read() 17164 if empty: 17165 return obj 17166 17167 # Process the inner elements: 17168 links = [] 17169 while reader.forward(): 17170 tag = reader.node_name() 17171 if tag == 'expiry': 17172 obj.expiry = Reader.read_integer(reader) 17173 elif tag == 'value': 17174 obj.value = Reader.read_string(reader) 17175 else: 17176 reader.next_element() 17177 for link in links: 17178 TicketReader._process_link(link, obj) 17179 17180 # Discard the end tag: 17181 reader.read() 17182 17183 return obj
17185 @staticmethod 17186 def read_many(reader): 17187 # Do nothing if there aren't more tags: 17188 objs = List() 17189 if not reader.forward(): 17190 return objs 17191 17192 # Process the attributes: 17193 objs.href = reader.get_attribute('href') 17194 17195 # Discard the start tag: 17196 empty = reader.empty_element() 17197 reader.read() 17198 if empty: 17199 return objs 17200 17201 # Process the inner elements: 17202 while reader.forward(): 17203 objs.append(TicketReader.read_one(reader)) 17204 17205 # Discard the end tag: 17206 reader.read() 17207 17208 return objs
17211class TimeZoneReader(Reader): 17212 17213 def __init__(self): 17214 super(TimeZoneReader, self).__init__() 17215 17216 @staticmethod 17217 def read_one(reader): 17218 # Do nothing if there aren't more tags: 17219 if not reader.forward(): 17220 return None 17221 17222 # Create the object: 17223 obj = types.TimeZone() 17224 17225 # Process the attributes: 17226 obj.href = reader.get_attribute('href') 17227 17228 # Discard the start tag: 17229 empty = reader.empty_element() 17230 reader.read() 17231 if empty: 17232 return obj 17233 17234 # Process the inner elements: 17235 links = [] 17236 while reader.forward(): 17237 tag = reader.node_name() 17238 if tag == 'name': 17239 obj.name = Reader.read_string(reader) 17240 elif tag == 'utc_offset': 17241 obj.utc_offset = Reader.read_string(reader) 17242 else: 17243 reader.next_element() 17244 for link in links: 17245 TimeZoneReader._process_link(link, obj) 17246 17247 # Discard the end tag: 17248 reader.read() 17249 17250 return obj 17251 17252 @staticmethod 17253 def read_many(reader): 17254 # Do nothing if there aren't more tags: 17255 objs = List() 17256 if not reader.forward(): 17257 return objs 17258 17259 # Process the attributes: 17260 objs.href = reader.get_attribute('href') 17261 17262 # Discard the start tag: 17263 empty = reader.empty_element() 17264 reader.read() 17265 if empty: 17266 return objs 17267 17268 # Process the inner elements: 17269 while reader.forward(): 17270 objs.append(TimeZoneReader.read_one(reader)) 17271 17272 # Discard the end tag: 17273 reader.read() 17274 17275 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17216 @staticmethod 17217 def read_one(reader): 17218 # Do nothing if there aren't more tags: 17219 if not reader.forward(): 17220 return None 17221 17222 # Create the object: 17223 obj = types.TimeZone() 17224 17225 # Process the attributes: 17226 obj.href = reader.get_attribute('href') 17227 17228 # Discard the start tag: 17229 empty = reader.empty_element() 17230 reader.read() 17231 if empty: 17232 return obj 17233 17234 # Process the inner elements: 17235 links = [] 17236 while reader.forward(): 17237 tag = reader.node_name() 17238 if tag == 'name': 17239 obj.name = Reader.read_string(reader) 17240 elif tag == 'utc_offset': 17241 obj.utc_offset = Reader.read_string(reader) 17242 else: 17243 reader.next_element() 17244 for link in links: 17245 TimeZoneReader._process_link(link, obj) 17246 17247 # Discard the end tag: 17248 reader.read() 17249 17250 return obj
17252 @staticmethod 17253 def read_many(reader): 17254 # Do nothing if there aren't more tags: 17255 objs = List() 17256 if not reader.forward(): 17257 return objs 17258 17259 # Process the attributes: 17260 objs.href = reader.get_attribute('href') 17261 17262 # Discard the start tag: 17263 empty = reader.empty_element() 17264 reader.read() 17265 if empty: 17266 return objs 17267 17268 # Process the inner elements: 17269 while reader.forward(): 17270 objs.append(TimeZoneReader.read_one(reader)) 17271 17272 # Discard the end tag: 17273 reader.read() 17274 17275 return objs
17278class TransparentHugePagesReader(Reader): 17279 17280 def __init__(self): 17281 super(TransparentHugePagesReader, self).__init__() 17282 17283 @staticmethod 17284 def read_one(reader): 17285 # Do nothing if there aren't more tags: 17286 if not reader.forward(): 17287 return None 17288 17289 # Create the object: 17290 obj = types.TransparentHugePages() 17291 17292 # Process the attributes: 17293 obj.href = reader.get_attribute('href') 17294 17295 # Discard the start tag: 17296 empty = reader.empty_element() 17297 reader.read() 17298 if empty: 17299 return obj 17300 17301 # Process the inner elements: 17302 links = [] 17303 while reader.forward(): 17304 tag = reader.node_name() 17305 if tag == 'enabled': 17306 obj.enabled = Reader.read_boolean(reader) 17307 else: 17308 reader.next_element() 17309 for link in links: 17310 TransparentHugePagesReader._process_link(link, obj) 17311 17312 # Discard the end tag: 17313 reader.read() 17314 17315 return obj 17316 17317 @staticmethod 17318 def read_many(reader): 17319 # Do nothing if there aren't more tags: 17320 objs = List() 17321 if not reader.forward(): 17322 return objs 17323 17324 # Process the attributes: 17325 objs.href = reader.get_attribute('href') 17326 17327 # Discard the start tag: 17328 empty = reader.empty_element() 17329 reader.read() 17330 if empty: 17331 return objs 17332 17333 # Process the inner elements: 17334 while reader.forward(): 17335 objs.append(TransparentHugePagesReader.read_one(reader)) 17336 17337 # Discard the end tag: 17338 reader.read() 17339 17340 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17283 @staticmethod 17284 def read_one(reader): 17285 # Do nothing if there aren't more tags: 17286 if not reader.forward(): 17287 return None 17288 17289 # Create the object: 17290 obj = types.TransparentHugePages() 17291 17292 # Process the attributes: 17293 obj.href = reader.get_attribute('href') 17294 17295 # Discard the start tag: 17296 empty = reader.empty_element() 17297 reader.read() 17298 if empty: 17299 return obj 17300 17301 # Process the inner elements: 17302 links = [] 17303 while reader.forward(): 17304 tag = reader.node_name() 17305 if tag == 'enabled': 17306 obj.enabled = Reader.read_boolean(reader) 17307 else: 17308 reader.next_element() 17309 for link in links: 17310 TransparentHugePagesReader._process_link(link, obj) 17311 17312 # Discard the end tag: 17313 reader.read() 17314 17315 return obj
17317 @staticmethod 17318 def read_many(reader): 17319 # Do nothing if there aren't more tags: 17320 objs = List() 17321 if not reader.forward(): 17322 return objs 17323 17324 # Process the attributes: 17325 objs.href = reader.get_attribute('href') 17326 17327 # Discard the start tag: 17328 empty = reader.empty_element() 17329 reader.read() 17330 if empty: 17331 return objs 17332 17333 # Process the inner elements: 17334 while reader.forward(): 17335 objs.append(TransparentHugePagesReader.read_one(reader)) 17336 17337 # Discard the end tag: 17338 reader.read() 17339 17340 return objs
17343class UnmanagedNetworkReader(Reader): 17344 17345 def __init__(self): 17346 super(UnmanagedNetworkReader, self).__init__() 17347 17348 @staticmethod 17349 def read_one(reader): 17350 # Do nothing if there aren't more tags: 17351 if not reader.forward(): 17352 return None 17353 17354 # Create the object: 17355 obj = types.UnmanagedNetwork() 17356 17357 # Process the attributes: 17358 obj.href = reader.get_attribute('href') 17359 value = reader.get_attribute('id') 17360 if value is not None: 17361 obj.id = value 17362 17363 # Discard the start tag: 17364 empty = reader.empty_element() 17365 reader.read() 17366 if empty: 17367 return obj 17368 17369 # Process the inner elements: 17370 links = [] 17371 while reader.forward(): 17372 tag = reader.node_name() 17373 if tag == 'comment': 17374 obj.comment = Reader.read_string(reader) 17375 elif tag == 'description': 17376 obj.description = Reader.read_string(reader) 17377 elif tag == 'host': 17378 obj.host = HostReader.read_one(reader) 17379 elif tag == 'host_nic': 17380 obj.host_nic = HostNicReader.read_one(reader) 17381 elif tag == 'name': 17382 obj.name = Reader.read_string(reader) 17383 else: 17384 reader.next_element() 17385 for link in links: 17386 UnmanagedNetworkReader._process_link(link, obj) 17387 17388 # Discard the end tag: 17389 reader.read() 17390 17391 return obj 17392 17393 @staticmethod 17394 def read_many(reader): 17395 # Do nothing if there aren't more tags: 17396 objs = List() 17397 if not reader.forward(): 17398 return objs 17399 17400 # Process the attributes: 17401 objs.href = reader.get_attribute('href') 17402 17403 # Discard the start tag: 17404 empty = reader.empty_element() 17405 reader.read() 17406 if empty: 17407 return objs 17408 17409 # Process the inner elements: 17410 while reader.forward(): 17411 objs.append(UnmanagedNetworkReader.read_one(reader)) 17412 17413 # Discard the end tag: 17414 reader.read() 17415 17416 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17348 @staticmethod 17349 def read_one(reader): 17350 # Do nothing if there aren't more tags: 17351 if not reader.forward(): 17352 return None 17353 17354 # Create the object: 17355 obj = types.UnmanagedNetwork() 17356 17357 # Process the attributes: 17358 obj.href = reader.get_attribute('href') 17359 value = reader.get_attribute('id') 17360 if value is not None: 17361 obj.id = value 17362 17363 # Discard the start tag: 17364 empty = reader.empty_element() 17365 reader.read() 17366 if empty: 17367 return obj 17368 17369 # Process the inner elements: 17370 links = [] 17371 while reader.forward(): 17372 tag = reader.node_name() 17373 if tag == 'comment': 17374 obj.comment = Reader.read_string(reader) 17375 elif tag == 'description': 17376 obj.description = Reader.read_string(reader) 17377 elif tag == 'host': 17378 obj.host = HostReader.read_one(reader) 17379 elif tag == 'host_nic': 17380 obj.host_nic = HostNicReader.read_one(reader) 17381 elif tag == 'name': 17382 obj.name = Reader.read_string(reader) 17383 else: 17384 reader.next_element() 17385 for link in links: 17386 UnmanagedNetworkReader._process_link(link, obj) 17387 17388 # Discard the end tag: 17389 reader.read() 17390 17391 return obj
17393 @staticmethod 17394 def read_many(reader): 17395 # Do nothing if there aren't more tags: 17396 objs = List() 17397 if not reader.forward(): 17398 return objs 17399 17400 # Process the attributes: 17401 objs.href = reader.get_attribute('href') 17402 17403 # Discard the start tag: 17404 empty = reader.empty_element() 17405 reader.read() 17406 if empty: 17407 return objs 17408 17409 # Process the inner elements: 17410 while reader.forward(): 17411 objs.append(UnmanagedNetworkReader.read_one(reader)) 17412 17413 # Discard the end tag: 17414 reader.read() 17415 17416 return objs
17419class UsbReader(Reader): 17420 17421 def __init__(self): 17422 super(UsbReader, self).__init__() 17423 17424 @staticmethod 17425 def read_one(reader): 17426 # Do nothing if there aren't more tags: 17427 if not reader.forward(): 17428 return None 17429 17430 # Create the object: 17431 obj = types.Usb() 17432 17433 # Process the attributes: 17434 obj.href = reader.get_attribute('href') 17435 17436 # Discard the start tag: 17437 empty = reader.empty_element() 17438 reader.read() 17439 if empty: 17440 return obj 17441 17442 # Process the inner elements: 17443 links = [] 17444 while reader.forward(): 17445 tag = reader.node_name() 17446 if tag == 'enabled': 17447 obj.enabled = Reader.read_boolean(reader) 17448 elif tag == 'type': 17449 obj.type = Reader.read_enum(types.UsbType, reader) 17450 else: 17451 reader.next_element() 17452 for link in links: 17453 UsbReader._process_link(link, obj) 17454 17455 # Discard the end tag: 17456 reader.read() 17457 17458 return obj 17459 17460 @staticmethod 17461 def read_many(reader): 17462 # Do nothing if there aren't more tags: 17463 objs = List() 17464 if not reader.forward(): 17465 return objs 17466 17467 # Process the attributes: 17468 objs.href = reader.get_attribute('href') 17469 17470 # Discard the start tag: 17471 empty = reader.empty_element() 17472 reader.read() 17473 if empty: 17474 return objs 17475 17476 # Process the inner elements: 17477 while reader.forward(): 17478 objs.append(UsbReader.read_one(reader)) 17479 17480 # Discard the end tag: 17481 reader.read() 17482 17483 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17424 @staticmethod 17425 def read_one(reader): 17426 # Do nothing if there aren't more tags: 17427 if not reader.forward(): 17428 return None 17429 17430 # Create the object: 17431 obj = types.Usb() 17432 17433 # Process the attributes: 17434 obj.href = reader.get_attribute('href') 17435 17436 # Discard the start tag: 17437 empty = reader.empty_element() 17438 reader.read() 17439 if empty: 17440 return obj 17441 17442 # Process the inner elements: 17443 links = [] 17444 while reader.forward(): 17445 tag = reader.node_name() 17446 if tag == 'enabled': 17447 obj.enabled = Reader.read_boolean(reader) 17448 elif tag == 'type': 17449 obj.type = Reader.read_enum(types.UsbType, reader) 17450 else: 17451 reader.next_element() 17452 for link in links: 17453 UsbReader._process_link(link, obj) 17454 17455 # Discard the end tag: 17456 reader.read() 17457 17458 return obj
17460 @staticmethod 17461 def read_many(reader): 17462 # Do nothing if there aren't more tags: 17463 objs = List() 17464 if not reader.forward(): 17465 return objs 17466 17467 # Process the attributes: 17468 objs.href = reader.get_attribute('href') 17469 17470 # Discard the start tag: 17471 empty = reader.empty_element() 17472 reader.read() 17473 if empty: 17474 return objs 17475 17476 # Process the inner elements: 17477 while reader.forward(): 17478 objs.append(UsbReader.read_one(reader)) 17479 17480 # Discard the end tag: 17481 reader.read() 17482 17483 return objs
17486class UserReader(Reader): 17487 17488 def __init__(self): 17489 super(UserReader, self).__init__() 17490 17491 @staticmethod 17492 def read_one(reader): 17493 # Do nothing if there aren't more tags: 17494 if not reader.forward(): 17495 return None 17496 17497 # Create the object: 17498 obj = types.User() 17499 17500 # Process the attributes: 17501 obj.href = reader.get_attribute('href') 17502 value = reader.get_attribute('id') 17503 if value is not None: 17504 obj.id = value 17505 17506 # Discard the start tag: 17507 empty = reader.empty_element() 17508 reader.read() 17509 if empty: 17510 return obj 17511 17512 # Process the inner elements: 17513 links = [] 17514 while reader.forward(): 17515 tag = reader.node_name() 17516 if tag == 'comment': 17517 obj.comment = Reader.read_string(reader) 17518 elif tag == 'department': 17519 obj.department = Reader.read_string(reader) 17520 elif tag == 'description': 17521 obj.description = Reader.read_string(reader) 17522 elif tag == 'domain': 17523 obj.domain = DomainReader.read_one(reader) 17524 elif tag == 'domain_entry_id': 17525 obj.domain_entry_id = Reader.read_string(reader) 17526 elif tag == 'email': 17527 obj.email = Reader.read_string(reader) 17528 elif tag == 'groups': 17529 obj.groups = GroupReader.read_many(reader) 17530 elif tag == 'last_name': 17531 obj.last_name = Reader.read_string(reader) 17532 elif tag == 'logged_in': 17533 obj.logged_in = Reader.read_boolean(reader) 17534 elif tag == 'name': 17535 obj.name = Reader.read_string(reader) 17536 elif tag == 'namespace': 17537 obj.namespace = Reader.read_string(reader) 17538 elif tag == 'options': 17539 obj.options = UserOptionReader.read_many(reader) 17540 elif tag == 'password': 17541 obj.password = Reader.read_string(reader) 17542 elif tag == 'permissions': 17543 obj.permissions = PermissionReader.read_many(reader) 17544 elif tag == 'principal': 17545 obj.principal = Reader.read_string(reader) 17546 elif tag == 'roles': 17547 obj.roles = RoleReader.read_many(reader) 17548 elif tag == 'ssh_public_keys': 17549 obj.ssh_public_keys = SshPublicKeyReader.read_many(reader) 17550 elif tag == 'tags': 17551 obj.tags = TagReader.read_many(reader) 17552 elif tag == 'user_name': 17553 obj.user_name = Reader.read_string(reader) 17554 elif tag == 'user_options': 17555 obj.user_options = PropertyReader.read_many(reader) 17556 elif tag == 'link': 17557 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 17558 reader.next_element() 17559 else: 17560 reader.next_element() 17561 for link in links: 17562 UserReader._process_link(link, obj) 17563 17564 # Discard the end tag: 17565 reader.read() 17566 17567 return obj 17568 17569 @staticmethod 17570 def read_many(reader): 17571 # Do nothing if there aren't more tags: 17572 objs = List() 17573 if not reader.forward(): 17574 return objs 17575 17576 # Process the attributes: 17577 objs.href = reader.get_attribute('href') 17578 17579 # Discard the start tag: 17580 empty = reader.empty_element() 17581 reader.read() 17582 if empty: 17583 return objs 17584 17585 # Process the inner elements: 17586 while reader.forward(): 17587 objs.append(UserReader.read_one(reader)) 17588 17589 # Discard the end tag: 17590 reader.read() 17591 17592 return objs 17593 17594 @staticmethod 17595 def _process_link(link, obj): 17596 # Process the attributes: 17597 rel = link[0] 17598 href = link[1] 17599 if href and rel: 17600 if rel == "groups": 17601 if obj.groups is not None: 17602 obj.groups.href = href 17603 else: 17604 obj.groups = List(href) 17605 elif rel == "options": 17606 if obj.options is not None: 17607 obj.options.href = href 17608 else: 17609 obj.options = List(href) 17610 elif rel == "permissions": 17611 if obj.permissions is not None: 17612 obj.permissions.href = href 17613 else: 17614 obj.permissions = List(href) 17615 elif rel == "roles": 17616 if obj.roles is not None: 17617 obj.roles.href = href 17618 else: 17619 obj.roles = List(href) 17620 elif rel == "sshpublickeys": 17621 if obj.ssh_public_keys is not None: 17622 obj.ssh_public_keys.href = href 17623 else: 17624 obj.ssh_public_keys = List(href) 17625 elif rel == "tags": 17626 if obj.tags is not None: 17627 obj.tags.href = href 17628 else: 17629 obj.tags = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17491 @staticmethod 17492 def read_one(reader): 17493 # Do nothing if there aren't more tags: 17494 if not reader.forward(): 17495 return None 17496 17497 # Create the object: 17498 obj = types.User() 17499 17500 # Process the attributes: 17501 obj.href = reader.get_attribute('href') 17502 value = reader.get_attribute('id') 17503 if value is not None: 17504 obj.id = value 17505 17506 # Discard the start tag: 17507 empty = reader.empty_element() 17508 reader.read() 17509 if empty: 17510 return obj 17511 17512 # Process the inner elements: 17513 links = [] 17514 while reader.forward(): 17515 tag = reader.node_name() 17516 if tag == 'comment': 17517 obj.comment = Reader.read_string(reader) 17518 elif tag == 'department': 17519 obj.department = Reader.read_string(reader) 17520 elif tag == 'description': 17521 obj.description = Reader.read_string(reader) 17522 elif tag == 'domain': 17523 obj.domain = DomainReader.read_one(reader) 17524 elif tag == 'domain_entry_id': 17525 obj.domain_entry_id = Reader.read_string(reader) 17526 elif tag == 'email': 17527 obj.email = Reader.read_string(reader) 17528 elif tag == 'groups': 17529 obj.groups = GroupReader.read_many(reader) 17530 elif tag == 'last_name': 17531 obj.last_name = Reader.read_string(reader) 17532 elif tag == 'logged_in': 17533 obj.logged_in = Reader.read_boolean(reader) 17534 elif tag == 'name': 17535 obj.name = Reader.read_string(reader) 17536 elif tag == 'namespace': 17537 obj.namespace = Reader.read_string(reader) 17538 elif tag == 'options': 17539 obj.options = UserOptionReader.read_many(reader) 17540 elif tag == 'password': 17541 obj.password = Reader.read_string(reader) 17542 elif tag == 'permissions': 17543 obj.permissions = PermissionReader.read_many(reader) 17544 elif tag == 'principal': 17545 obj.principal = Reader.read_string(reader) 17546 elif tag == 'roles': 17547 obj.roles = RoleReader.read_many(reader) 17548 elif tag == 'ssh_public_keys': 17549 obj.ssh_public_keys = SshPublicKeyReader.read_many(reader) 17550 elif tag == 'tags': 17551 obj.tags = TagReader.read_many(reader) 17552 elif tag == 'user_name': 17553 obj.user_name = Reader.read_string(reader) 17554 elif tag == 'user_options': 17555 obj.user_options = PropertyReader.read_many(reader) 17556 elif tag == 'link': 17557 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 17558 reader.next_element() 17559 else: 17560 reader.next_element() 17561 for link in links: 17562 UserReader._process_link(link, obj) 17563 17564 # Discard the end tag: 17565 reader.read() 17566 17567 return obj
17569 @staticmethod 17570 def read_many(reader): 17571 # Do nothing if there aren't more tags: 17572 objs = List() 17573 if not reader.forward(): 17574 return objs 17575 17576 # Process the attributes: 17577 objs.href = reader.get_attribute('href') 17578 17579 # Discard the start tag: 17580 empty = reader.empty_element() 17581 reader.read() 17582 if empty: 17583 return objs 17584 17585 # Process the inner elements: 17586 while reader.forward(): 17587 objs.append(UserReader.read_one(reader)) 17588 17589 # Discard the end tag: 17590 reader.read() 17591 17592 return objs
17632class UserOptionReader(Reader): 17633 17634 def __init__(self): 17635 super(UserOptionReader, self).__init__() 17636 17637 @staticmethod 17638 def read_one(reader): 17639 # Do nothing if there aren't more tags: 17640 if not reader.forward(): 17641 return None 17642 17643 # Create the object: 17644 obj = types.UserOption() 17645 17646 # Process the attributes: 17647 obj.href = reader.get_attribute('href') 17648 value = reader.get_attribute('id') 17649 if value is not None: 17650 obj.id = value 17651 17652 # Discard the start tag: 17653 empty = reader.empty_element() 17654 reader.read() 17655 if empty: 17656 return obj 17657 17658 # Process the inner elements: 17659 links = [] 17660 while reader.forward(): 17661 tag = reader.node_name() 17662 if tag == 'comment': 17663 obj.comment = Reader.read_string(reader) 17664 elif tag == 'content': 17665 obj.content = Reader.read_string(reader) 17666 elif tag == 'description': 17667 obj.description = Reader.read_string(reader) 17668 elif tag == 'name': 17669 obj.name = Reader.read_string(reader) 17670 elif tag == 'user': 17671 obj.user = UserReader.read_one(reader) 17672 else: 17673 reader.next_element() 17674 for link in links: 17675 UserOptionReader._process_link(link, obj) 17676 17677 # Discard the end tag: 17678 reader.read() 17679 17680 return obj 17681 17682 @staticmethod 17683 def read_many(reader): 17684 # Do nothing if there aren't more tags: 17685 objs = List() 17686 if not reader.forward(): 17687 return objs 17688 17689 # Process the attributes: 17690 objs.href = reader.get_attribute('href') 17691 17692 # Discard the start tag: 17693 empty = reader.empty_element() 17694 reader.read() 17695 if empty: 17696 return objs 17697 17698 # Process the inner elements: 17699 while reader.forward(): 17700 objs.append(UserOptionReader.read_one(reader)) 17701 17702 # Discard the end tag: 17703 reader.read() 17704 17705 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17637 @staticmethod 17638 def read_one(reader): 17639 # Do nothing if there aren't more tags: 17640 if not reader.forward(): 17641 return None 17642 17643 # Create the object: 17644 obj = types.UserOption() 17645 17646 # Process the attributes: 17647 obj.href = reader.get_attribute('href') 17648 value = reader.get_attribute('id') 17649 if value is not None: 17650 obj.id = value 17651 17652 # Discard the start tag: 17653 empty = reader.empty_element() 17654 reader.read() 17655 if empty: 17656 return obj 17657 17658 # Process the inner elements: 17659 links = [] 17660 while reader.forward(): 17661 tag = reader.node_name() 17662 if tag == 'comment': 17663 obj.comment = Reader.read_string(reader) 17664 elif tag == 'content': 17665 obj.content = Reader.read_string(reader) 17666 elif tag == 'description': 17667 obj.description = Reader.read_string(reader) 17668 elif tag == 'name': 17669 obj.name = Reader.read_string(reader) 17670 elif tag == 'user': 17671 obj.user = UserReader.read_one(reader) 17672 else: 17673 reader.next_element() 17674 for link in links: 17675 UserOptionReader._process_link(link, obj) 17676 17677 # Discard the end tag: 17678 reader.read() 17679 17680 return obj
17682 @staticmethod 17683 def read_many(reader): 17684 # Do nothing if there aren't more tags: 17685 objs = List() 17686 if not reader.forward(): 17687 return objs 17688 17689 # Process the attributes: 17690 objs.href = reader.get_attribute('href') 17691 17692 # Discard the start tag: 17693 empty = reader.empty_element() 17694 reader.read() 17695 if empty: 17696 return objs 17697 17698 # Process the inner elements: 17699 while reader.forward(): 17700 objs.append(UserOptionReader.read_one(reader)) 17701 17702 # Discard the end tag: 17703 reader.read() 17704 17705 return objs
17708class ValueReader(Reader): 17709 17710 def __init__(self): 17711 super(ValueReader, self).__init__() 17712 17713 @staticmethod 17714 def read_one(reader): 17715 # Do nothing if there aren't more tags: 17716 if not reader.forward(): 17717 return None 17718 17719 # Create the object: 17720 obj = types.Value() 17721 17722 # Process the attributes: 17723 obj.href = reader.get_attribute('href') 17724 17725 # Discard the start tag: 17726 empty = reader.empty_element() 17727 reader.read() 17728 if empty: 17729 return obj 17730 17731 # Process the inner elements: 17732 links = [] 17733 while reader.forward(): 17734 tag = reader.node_name() 17735 if tag == 'datum': 17736 obj.datum = Reader.read_decimal(reader) 17737 elif tag == 'detail': 17738 obj.detail = Reader.read_string(reader) 17739 else: 17740 reader.next_element() 17741 for link in links: 17742 ValueReader._process_link(link, obj) 17743 17744 # Discard the end tag: 17745 reader.read() 17746 17747 return obj 17748 17749 @staticmethod 17750 def read_many(reader): 17751 # Do nothing if there aren't more tags: 17752 objs = List() 17753 if not reader.forward(): 17754 return objs 17755 17756 # Process the attributes: 17757 objs.href = reader.get_attribute('href') 17758 17759 # Discard the start tag: 17760 empty = reader.empty_element() 17761 reader.read() 17762 if empty: 17763 return objs 17764 17765 # Process the inner elements: 17766 while reader.forward(): 17767 objs.append(ValueReader.read_one(reader)) 17768 17769 # Discard the end tag: 17770 reader.read() 17771 17772 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17713 @staticmethod 17714 def read_one(reader): 17715 # Do nothing if there aren't more tags: 17716 if not reader.forward(): 17717 return None 17718 17719 # Create the object: 17720 obj = types.Value() 17721 17722 # Process the attributes: 17723 obj.href = reader.get_attribute('href') 17724 17725 # Discard the start tag: 17726 empty = reader.empty_element() 17727 reader.read() 17728 if empty: 17729 return obj 17730 17731 # Process the inner elements: 17732 links = [] 17733 while reader.forward(): 17734 tag = reader.node_name() 17735 if tag == 'datum': 17736 obj.datum = Reader.read_decimal(reader) 17737 elif tag == 'detail': 17738 obj.detail = Reader.read_string(reader) 17739 else: 17740 reader.next_element() 17741 for link in links: 17742 ValueReader._process_link(link, obj) 17743 17744 # Discard the end tag: 17745 reader.read() 17746 17747 return obj
17749 @staticmethod 17750 def read_many(reader): 17751 # Do nothing if there aren't more tags: 17752 objs = List() 17753 if not reader.forward(): 17754 return objs 17755 17756 # Process the attributes: 17757 objs.href = reader.get_attribute('href') 17758 17759 # Discard the start tag: 17760 empty = reader.empty_element() 17761 reader.read() 17762 if empty: 17763 return objs 17764 17765 # Process the inner elements: 17766 while reader.forward(): 17767 objs.append(ValueReader.read_one(reader)) 17768 17769 # Discard the end tag: 17770 reader.read() 17771 17772 return objs
17775class VcpuPinReader(Reader): 17776 17777 def __init__(self): 17778 super(VcpuPinReader, self).__init__() 17779 17780 @staticmethod 17781 def read_one(reader): 17782 # Do nothing if there aren't more tags: 17783 if not reader.forward(): 17784 return None 17785 17786 # Create the object: 17787 obj = types.VcpuPin() 17788 17789 # Process the attributes: 17790 obj.href = reader.get_attribute('href') 17791 17792 # Discard the start tag: 17793 empty = reader.empty_element() 17794 reader.read() 17795 if empty: 17796 return obj 17797 17798 # Process the inner elements: 17799 links = [] 17800 while reader.forward(): 17801 tag = reader.node_name() 17802 if tag == 'cpu_set': 17803 obj.cpu_set = Reader.read_string(reader) 17804 elif tag == 'vcpu': 17805 obj.vcpu = Reader.read_integer(reader) 17806 else: 17807 reader.next_element() 17808 for link in links: 17809 VcpuPinReader._process_link(link, obj) 17810 17811 # Discard the end tag: 17812 reader.read() 17813 17814 return obj 17815 17816 @staticmethod 17817 def read_many(reader): 17818 # Do nothing if there aren't more tags: 17819 objs = List() 17820 if not reader.forward(): 17821 return objs 17822 17823 # Process the attributes: 17824 objs.href = reader.get_attribute('href') 17825 17826 # Discard the start tag: 17827 empty = reader.empty_element() 17828 reader.read() 17829 if empty: 17830 return objs 17831 17832 # Process the inner elements: 17833 while reader.forward(): 17834 objs.append(VcpuPinReader.read_one(reader)) 17835 17836 # Discard the end tag: 17837 reader.read() 17838 17839 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17780 @staticmethod 17781 def read_one(reader): 17782 # Do nothing if there aren't more tags: 17783 if not reader.forward(): 17784 return None 17785 17786 # Create the object: 17787 obj = types.VcpuPin() 17788 17789 # Process the attributes: 17790 obj.href = reader.get_attribute('href') 17791 17792 # Discard the start tag: 17793 empty = reader.empty_element() 17794 reader.read() 17795 if empty: 17796 return obj 17797 17798 # Process the inner elements: 17799 links = [] 17800 while reader.forward(): 17801 tag = reader.node_name() 17802 if tag == 'cpu_set': 17803 obj.cpu_set = Reader.read_string(reader) 17804 elif tag == 'vcpu': 17805 obj.vcpu = Reader.read_integer(reader) 17806 else: 17807 reader.next_element() 17808 for link in links: 17809 VcpuPinReader._process_link(link, obj) 17810 17811 # Discard the end tag: 17812 reader.read() 17813 17814 return obj
17816 @staticmethod 17817 def read_many(reader): 17818 # Do nothing if there aren't more tags: 17819 objs = List() 17820 if not reader.forward(): 17821 return objs 17822 17823 # Process the attributes: 17824 objs.href = reader.get_attribute('href') 17825 17826 # Discard the start tag: 17827 empty = reader.empty_element() 17828 reader.read() 17829 if empty: 17830 return objs 17831 17832 # Process the inner elements: 17833 while reader.forward(): 17834 objs.append(VcpuPinReader.read_one(reader)) 17835 17836 # Discard the end tag: 17837 reader.read() 17838 17839 return objs
17842class VendorReader(Reader): 17843 17844 def __init__(self): 17845 super(VendorReader, self).__init__() 17846 17847 @staticmethod 17848 def read_one(reader): 17849 # Do nothing if there aren't more tags: 17850 if not reader.forward(): 17851 return None 17852 17853 # Create the object: 17854 obj = types.Vendor() 17855 17856 # Process the attributes: 17857 obj.href = reader.get_attribute('href') 17858 value = reader.get_attribute('id') 17859 if value is not None: 17860 obj.id = value 17861 17862 # Discard the start tag: 17863 empty = reader.empty_element() 17864 reader.read() 17865 if empty: 17866 return obj 17867 17868 # Process the inner elements: 17869 links = [] 17870 while reader.forward(): 17871 tag = reader.node_name() 17872 if tag == 'comment': 17873 obj.comment = Reader.read_string(reader) 17874 elif tag == 'description': 17875 obj.description = Reader.read_string(reader) 17876 elif tag == 'name': 17877 obj.name = Reader.read_string(reader) 17878 else: 17879 reader.next_element() 17880 for link in links: 17881 VendorReader._process_link(link, obj) 17882 17883 # Discard the end tag: 17884 reader.read() 17885 17886 return obj 17887 17888 @staticmethod 17889 def read_many(reader): 17890 # Do nothing if there aren't more tags: 17891 objs = List() 17892 if not reader.forward(): 17893 return objs 17894 17895 # Process the attributes: 17896 objs.href = reader.get_attribute('href') 17897 17898 # Discard the start tag: 17899 empty = reader.empty_element() 17900 reader.read() 17901 if empty: 17902 return objs 17903 17904 # Process the inner elements: 17905 while reader.forward(): 17906 objs.append(VendorReader.read_one(reader)) 17907 17908 # Discard the end tag: 17909 reader.read() 17910 17911 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17847 @staticmethod 17848 def read_one(reader): 17849 # Do nothing if there aren't more tags: 17850 if not reader.forward(): 17851 return None 17852 17853 # Create the object: 17854 obj = types.Vendor() 17855 17856 # Process the attributes: 17857 obj.href = reader.get_attribute('href') 17858 value = reader.get_attribute('id') 17859 if value is not None: 17860 obj.id = value 17861 17862 # Discard the start tag: 17863 empty = reader.empty_element() 17864 reader.read() 17865 if empty: 17866 return obj 17867 17868 # Process the inner elements: 17869 links = [] 17870 while reader.forward(): 17871 tag = reader.node_name() 17872 if tag == 'comment': 17873 obj.comment = Reader.read_string(reader) 17874 elif tag == 'description': 17875 obj.description = Reader.read_string(reader) 17876 elif tag == 'name': 17877 obj.name = Reader.read_string(reader) 17878 else: 17879 reader.next_element() 17880 for link in links: 17881 VendorReader._process_link(link, obj) 17882 17883 # Discard the end tag: 17884 reader.read() 17885 17886 return obj
17888 @staticmethod 17889 def read_many(reader): 17890 # Do nothing if there aren't more tags: 17891 objs = List() 17892 if not reader.forward(): 17893 return objs 17894 17895 # Process the attributes: 17896 objs.href = reader.get_attribute('href') 17897 17898 # Discard the start tag: 17899 empty = reader.empty_element() 17900 reader.read() 17901 if empty: 17902 return objs 17903 17904 # Process the inner elements: 17905 while reader.forward(): 17906 objs.append(VendorReader.read_one(reader)) 17907 17908 # Discard the end tag: 17909 reader.read() 17910 17911 return objs
17914class VersionReader(Reader): 17915 17916 def __init__(self): 17917 super(VersionReader, self).__init__() 17918 17919 @staticmethod 17920 def read_one(reader): 17921 # Do nothing if there aren't more tags: 17922 if not reader.forward(): 17923 return None 17924 17925 # Create the object: 17926 obj = types.Version() 17927 17928 # Process the attributes: 17929 obj.href = reader.get_attribute('href') 17930 value = reader.get_attribute('id') 17931 if value is not None: 17932 obj.id = value 17933 17934 # Discard the start tag: 17935 empty = reader.empty_element() 17936 reader.read() 17937 if empty: 17938 return obj 17939 17940 # Process the inner elements: 17941 links = [] 17942 while reader.forward(): 17943 tag = reader.node_name() 17944 if tag == 'build': 17945 obj.build = Reader.read_integer(reader) 17946 elif tag == 'comment': 17947 obj.comment = Reader.read_string(reader) 17948 elif tag == 'description': 17949 obj.description = Reader.read_string(reader) 17950 elif tag == 'full_version': 17951 obj.full_version = Reader.read_string(reader) 17952 elif tag == 'major': 17953 obj.major = Reader.read_integer(reader) 17954 elif tag == 'minor': 17955 obj.minor = Reader.read_integer(reader) 17956 elif tag == 'name': 17957 obj.name = Reader.read_string(reader) 17958 elif tag == 'revision': 17959 obj.revision = Reader.read_integer(reader) 17960 else: 17961 reader.next_element() 17962 for link in links: 17963 VersionReader._process_link(link, obj) 17964 17965 # Discard the end tag: 17966 reader.read() 17967 17968 return obj 17969 17970 @staticmethod 17971 def read_many(reader): 17972 # Do nothing if there aren't more tags: 17973 objs = List() 17974 if not reader.forward(): 17975 return objs 17976 17977 # Process the attributes: 17978 objs.href = reader.get_attribute('href') 17979 17980 # Discard the start tag: 17981 empty = reader.empty_element() 17982 reader.read() 17983 if empty: 17984 return objs 17985 17986 # Process the inner elements: 17987 while reader.forward(): 17988 objs.append(VersionReader.read_one(reader)) 17989 17990 # Discard the end tag: 17991 reader.read() 17992 17993 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
17919 @staticmethod 17920 def read_one(reader): 17921 # Do nothing if there aren't more tags: 17922 if not reader.forward(): 17923 return None 17924 17925 # Create the object: 17926 obj = types.Version() 17927 17928 # Process the attributes: 17929 obj.href = reader.get_attribute('href') 17930 value = reader.get_attribute('id') 17931 if value is not None: 17932 obj.id = value 17933 17934 # Discard the start tag: 17935 empty = reader.empty_element() 17936 reader.read() 17937 if empty: 17938 return obj 17939 17940 # Process the inner elements: 17941 links = [] 17942 while reader.forward(): 17943 tag = reader.node_name() 17944 if tag == 'build': 17945 obj.build = Reader.read_integer(reader) 17946 elif tag == 'comment': 17947 obj.comment = Reader.read_string(reader) 17948 elif tag == 'description': 17949 obj.description = Reader.read_string(reader) 17950 elif tag == 'full_version': 17951 obj.full_version = Reader.read_string(reader) 17952 elif tag == 'major': 17953 obj.major = Reader.read_integer(reader) 17954 elif tag == 'minor': 17955 obj.minor = Reader.read_integer(reader) 17956 elif tag == 'name': 17957 obj.name = Reader.read_string(reader) 17958 elif tag == 'revision': 17959 obj.revision = Reader.read_integer(reader) 17960 else: 17961 reader.next_element() 17962 for link in links: 17963 VersionReader._process_link(link, obj) 17964 17965 # Discard the end tag: 17966 reader.read() 17967 17968 return obj
17970 @staticmethod 17971 def read_many(reader): 17972 # Do nothing if there aren't more tags: 17973 objs = List() 17974 if not reader.forward(): 17975 return objs 17976 17977 # Process the attributes: 17978 objs.href = reader.get_attribute('href') 17979 17980 # Discard the start tag: 17981 empty = reader.empty_element() 17982 reader.read() 17983 if empty: 17984 return objs 17985 17986 # Process the inner elements: 17987 while reader.forward(): 17988 objs.append(VersionReader.read_one(reader)) 17989 17990 # Discard the end tag: 17991 reader.read() 17992 17993 return objs
17996class VirtioScsiReader(Reader): 17997 17998 def __init__(self): 17999 super(VirtioScsiReader, self).__init__() 18000 18001 @staticmethod 18002 def read_one(reader): 18003 # Do nothing if there aren't more tags: 18004 if not reader.forward(): 18005 return None 18006 18007 # Create the object: 18008 obj = types.VirtioScsi() 18009 18010 # Process the attributes: 18011 obj.href = reader.get_attribute('href') 18012 18013 # Discard the start tag: 18014 empty = reader.empty_element() 18015 reader.read() 18016 if empty: 18017 return obj 18018 18019 # Process the inner elements: 18020 links = [] 18021 while reader.forward(): 18022 tag = reader.node_name() 18023 if tag == 'enabled': 18024 obj.enabled = Reader.read_boolean(reader) 18025 else: 18026 reader.next_element() 18027 for link in links: 18028 VirtioScsiReader._process_link(link, obj) 18029 18030 # Discard the end tag: 18031 reader.read() 18032 18033 return obj 18034 18035 @staticmethod 18036 def read_many(reader): 18037 # Do nothing if there aren't more tags: 18038 objs = List() 18039 if not reader.forward(): 18040 return objs 18041 18042 # Process the attributes: 18043 objs.href = reader.get_attribute('href') 18044 18045 # Discard the start tag: 18046 empty = reader.empty_element() 18047 reader.read() 18048 if empty: 18049 return objs 18050 18051 # Process the inner elements: 18052 while reader.forward(): 18053 objs.append(VirtioScsiReader.read_one(reader)) 18054 18055 # Discard the end tag: 18056 reader.read() 18057 18058 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18001 @staticmethod 18002 def read_one(reader): 18003 # Do nothing if there aren't more tags: 18004 if not reader.forward(): 18005 return None 18006 18007 # Create the object: 18008 obj = types.VirtioScsi() 18009 18010 # Process the attributes: 18011 obj.href = reader.get_attribute('href') 18012 18013 # Discard the start tag: 18014 empty = reader.empty_element() 18015 reader.read() 18016 if empty: 18017 return obj 18018 18019 # Process the inner elements: 18020 links = [] 18021 while reader.forward(): 18022 tag = reader.node_name() 18023 if tag == 'enabled': 18024 obj.enabled = Reader.read_boolean(reader) 18025 else: 18026 reader.next_element() 18027 for link in links: 18028 VirtioScsiReader._process_link(link, obj) 18029 18030 # Discard the end tag: 18031 reader.read() 18032 18033 return obj
18035 @staticmethod 18036 def read_many(reader): 18037 # Do nothing if there aren't more tags: 18038 objs = List() 18039 if not reader.forward(): 18040 return objs 18041 18042 # Process the attributes: 18043 objs.href = reader.get_attribute('href') 18044 18045 # Discard the start tag: 18046 empty = reader.empty_element() 18047 reader.read() 18048 if empty: 18049 return objs 18050 18051 # Process the inner elements: 18052 while reader.forward(): 18053 objs.append(VirtioScsiReader.read_one(reader)) 18054 18055 # Discard the end tag: 18056 reader.read() 18057 18058 return objs
18061class VirtualNumaNodeReader(Reader): 18062 18063 def __init__(self): 18064 super(VirtualNumaNodeReader, self).__init__() 18065 18066 @staticmethod 18067 def read_one(reader): 18068 # Do nothing if there aren't more tags: 18069 if not reader.forward(): 18070 return None 18071 18072 # Create the object: 18073 obj = types.VirtualNumaNode() 18074 18075 # Process the attributes: 18076 obj.href = reader.get_attribute('href') 18077 value = reader.get_attribute('id') 18078 if value is not None: 18079 obj.id = value 18080 18081 # Discard the start tag: 18082 empty = reader.empty_element() 18083 reader.read() 18084 if empty: 18085 return obj 18086 18087 # Process the inner elements: 18088 links = [] 18089 while reader.forward(): 18090 tag = reader.node_name() 18091 if tag == 'comment': 18092 obj.comment = Reader.read_string(reader) 18093 elif tag == 'cpu': 18094 obj.cpu = CpuReader.read_one(reader) 18095 elif tag == 'description': 18096 obj.description = Reader.read_string(reader) 18097 elif tag == 'host': 18098 obj.host = HostReader.read_one(reader) 18099 elif tag == 'index': 18100 obj.index = Reader.read_integer(reader) 18101 elif tag == 'memory': 18102 obj.memory = Reader.read_integer(reader) 18103 elif tag == 'name': 18104 obj.name = Reader.read_string(reader) 18105 elif tag == 'node_distance': 18106 obj.node_distance = Reader.read_string(reader) 18107 elif tag == 'numa_node_pins': 18108 obj.numa_node_pins = NumaNodePinReader.read_many(reader) 18109 elif tag == 'numa_tune_mode': 18110 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18111 elif tag == 'statistics': 18112 obj.statistics = StatisticReader.read_many(reader) 18113 elif tag == 'vm': 18114 obj.vm = VmReader.read_one(reader) 18115 elif tag == 'link': 18116 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18117 reader.next_element() 18118 else: 18119 reader.next_element() 18120 for link in links: 18121 VirtualNumaNodeReader._process_link(link, obj) 18122 18123 # Discard the end tag: 18124 reader.read() 18125 18126 return obj 18127 18128 @staticmethod 18129 def read_many(reader): 18130 # Do nothing if there aren't more tags: 18131 objs = List() 18132 if not reader.forward(): 18133 return objs 18134 18135 # Process the attributes: 18136 objs.href = reader.get_attribute('href') 18137 18138 # Discard the start tag: 18139 empty = reader.empty_element() 18140 reader.read() 18141 if empty: 18142 return objs 18143 18144 # Process the inner elements: 18145 while reader.forward(): 18146 objs.append(VirtualNumaNodeReader.read_one(reader)) 18147 18148 # Discard the end tag: 18149 reader.read() 18150 18151 return objs 18152 18153 @staticmethod 18154 def _process_link(link, obj): 18155 # Process the attributes: 18156 rel = link[0] 18157 href = link[1] 18158 if href and rel: 18159 if rel == "statistics": 18160 if obj.statistics is not None: 18161 obj.statistics.href = href 18162 else: 18163 obj.statistics = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18066 @staticmethod 18067 def read_one(reader): 18068 # Do nothing if there aren't more tags: 18069 if not reader.forward(): 18070 return None 18071 18072 # Create the object: 18073 obj = types.VirtualNumaNode() 18074 18075 # Process the attributes: 18076 obj.href = reader.get_attribute('href') 18077 value = reader.get_attribute('id') 18078 if value is not None: 18079 obj.id = value 18080 18081 # Discard the start tag: 18082 empty = reader.empty_element() 18083 reader.read() 18084 if empty: 18085 return obj 18086 18087 # Process the inner elements: 18088 links = [] 18089 while reader.forward(): 18090 tag = reader.node_name() 18091 if tag == 'comment': 18092 obj.comment = Reader.read_string(reader) 18093 elif tag == 'cpu': 18094 obj.cpu = CpuReader.read_one(reader) 18095 elif tag == 'description': 18096 obj.description = Reader.read_string(reader) 18097 elif tag == 'host': 18098 obj.host = HostReader.read_one(reader) 18099 elif tag == 'index': 18100 obj.index = Reader.read_integer(reader) 18101 elif tag == 'memory': 18102 obj.memory = Reader.read_integer(reader) 18103 elif tag == 'name': 18104 obj.name = Reader.read_string(reader) 18105 elif tag == 'node_distance': 18106 obj.node_distance = Reader.read_string(reader) 18107 elif tag == 'numa_node_pins': 18108 obj.numa_node_pins = NumaNodePinReader.read_many(reader) 18109 elif tag == 'numa_tune_mode': 18110 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18111 elif tag == 'statistics': 18112 obj.statistics = StatisticReader.read_many(reader) 18113 elif tag == 'vm': 18114 obj.vm = VmReader.read_one(reader) 18115 elif tag == 'link': 18116 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18117 reader.next_element() 18118 else: 18119 reader.next_element() 18120 for link in links: 18121 VirtualNumaNodeReader._process_link(link, obj) 18122 18123 # Discard the end tag: 18124 reader.read() 18125 18126 return obj
18128 @staticmethod 18129 def read_many(reader): 18130 # Do nothing if there aren't more tags: 18131 objs = List() 18132 if not reader.forward(): 18133 return objs 18134 18135 # Process the attributes: 18136 objs.href = reader.get_attribute('href') 18137 18138 # Discard the start tag: 18139 empty = reader.empty_element() 18140 reader.read() 18141 if empty: 18142 return objs 18143 18144 # Process the inner elements: 18145 while reader.forward(): 18146 objs.append(VirtualNumaNodeReader.read_one(reader)) 18147 18148 # Discard the end tag: 18149 reader.read() 18150 18151 return objs
18166class VlanReader(Reader): 18167 18168 def __init__(self): 18169 super(VlanReader, self).__init__() 18170 18171 @staticmethod 18172 def read_one(reader): 18173 # Do nothing if there aren't more tags: 18174 if not reader.forward(): 18175 return None 18176 18177 # Create the object: 18178 obj = types.Vlan() 18179 18180 # Process the attributes: 18181 obj.href = reader.get_attribute('href') 18182 value = reader.get_attribute('id') 18183 if value is not None: 18184 obj.id = Reader.parse_integer(value) 18185 18186 # Discard the start tag: 18187 empty = reader.empty_element() 18188 reader.read() 18189 if empty: 18190 return obj 18191 18192 # Process the inner elements: 18193 reader.next_element() 18194 18195 # Discard the end tag: 18196 reader.read() 18197 18198 return obj 18199 18200 @staticmethod 18201 def read_many(reader): 18202 # Do nothing if there aren't more tags: 18203 objs = List() 18204 if not reader.forward(): 18205 return objs 18206 18207 # Process the attributes: 18208 objs.href = reader.get_attribute('href') 18209 18210 # Discard the start tag: 18211 empty = reader.empty_element() 18212 reader.read() 18213 if empty: 18214 return objs 18215 18216 # Process the inner elements: 18217 while reader.forward(): 18218 objs.append(VlanReader.read_one(reader)) 18219 18220 # Discard the end tag: 18221 reader.read() 18222 18223 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18171 @staticmethod 18172 def read_one(reader): 18173 # Do nothing if there aren't more tags: 18174 if not reader.forward(): 18175 return None 18176 18177 # Create the object: 18178 obj = types.Vlan() 18179 18180 # Process the attributes: 18181 obj.href = reader.get_attribute('href') 18182 value = reader.get_attribute('id') 18183 if value is not None: 18184 obj.id = Reader.parse_integer(value) 18185 18186 # Discard the start tag: 18187 empty = reader.empty_element() 18188 reader.read() 18189 if empty: 18190 return obj 18191 18192 # Process the inner elements: 18193 reader.next_element() 18194 18195 # Discard the end tag: 18196 reader.read() 18197 18198 return obj
18200 @staticmethod 18201 def read_many(reader): 18202 # Do nothing if there aren't more tags: 18203 objs = List() 18204 if not reader.forward(): 18205 return objs 18206 18207 # Process the attributes: 18208 objs.href = reader.get_attribute('href') 18209 18210 # Discard the start tag: 18211 empty = reader.empty_element() 18212 reader.read() 18213 if empty: 18214 return objs 18215 18216 # Process the inner elements: 18217 while reader.forward(): 18218 objs.append(VlanReader.read_one(reader)) 18219 18220 # Discard the end tag: 18221 reader.read() 18222 18223 return objs
18226class VmReader(Reader): 18227 18228 def __init__(self): 18229 super(VmReader, self).__init__() 18230 18231 @staticmethod 18232 def read_one(reader): 18233 # Do nothing if there aren't more tags: 18234 if not reader.forward(): 18235 return None 18236 18237 # Create the object: 18238 obj = types.Vm() 18239 18240 # Process the attributes: 18241 obj.href = reader.get_attribute('href') 18242 value = reader.get_attribute('id') 18243 if value is not None: 18244 obj.id = value 18245 18246 # Discard the start tag: 18247 empty = reader.empty_element() 18248 reader.read() 18249 if empty: 18250 return obj 18251 18252 # Process the inner elements: 18253 links = [] 18254 while reader.forward(): 18255 tag = reader.node_name() 18256 if tag == 'affinity_labels': 18257 obj.affinity_labels = AffinityLabelReader.read_many(reader) 18258 elif tag == 'applications': 18259 obj.applications = ApplicationReader.read_many(reader) 18260 elif tag == 'auto_pinning_policy': 18261 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18262 elif tag == 'bios': 18263 obj.bios = BiosReader.read_one(reader) 18264 elif tag == 'cdroms': 18265 obj.cdroms = CdromReader.read_many(reader) 18266 elif tag == 'cluster': 18267 obj.cluster = ClusterReader.read_one(reader) 18268 elif tag == 'comment': 18269 obj.comment = Reader.read_string(reader) 18270 elif tag == 'console': 18271 obj.console = ConsoleReader.read_one(reader) 18272 elif tag == 'cpu': 18273 obj.cpu = CpuReader.read_one(reader) 18274 elif tag == 'cpu_pinning_policy': 18275 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18276 elif tag == 'cpu_profile': 18277 obj.cpu_profile = CpuProfileReader.read_one(reader) 18278 elif tag == 'cpu_shares': 18279 obj.cpu_shares = Reader.read_integer(reader) 18280 elif tag == 'creation_time': 18281 obj.creation_time = Reader.read_date(reader) 18282 elif tag == 'custom_compatibility_version': 18283 obj.custom_compatibility_version = VersionReader.read_one(reader) 18284 elif tag == 'custom_cpu_model': 18285 obj.custom_cpu_model = Reader.read_string(reader) 18286 elif tag == 'custom_emulated_machine': 18287 obj.custom_emulated_machine = Reader.read_string(reader) 18288 elif tag == 'custom_properties': 18289 obj.custom_properties = CustomPropertyReader.read_many(reader) 18290 elif tag == 'delete_protected': 18291 obj.delete_protected = Reader.read_boolean(reader) 18292 elif tag == 'description': 18293 obj.description = Reader.read_string(reader) 18294 elif tag == 'disk_attachments': 18295 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 18296 elif tag == 'display': 18297 obj.display = DisplayReader.read_one(reader) 18298 elif tag == 'domain': 18299 obj.domain = DomainReader.read_one(reader) 18300 elif tag == 'dynamic_cpu': 18301 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 18302 elif tag == 'external_host_provider': 18303 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 18304 elif tag == 'floppies': 18305 obj.floppies = FloppyReader.read_many(reader) 18306 elif tag == 'fqdn': 18307 obj.fqdn = Reader.read_string(reader) 18308 elif tag == 'graphics_consoles': 18309 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 18310 elif tag == 'guest_operating_system': 18311 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 18312 elif tag == 'guest_time_zone': 18313 obj.guest_time_zone = TimeZoneReader.read_one(reader) 18314 elif tag == 'has_illegal_images': 18315 obj.has_illegal_images = Reader.read_boolean(reader) 18316 elif tag == 'high_availability': 18317 obj.high_availability = HighAvailabilityReader.read_one(reader) 18318 elif tag == 'host': 18319 obj.host = HostReader.read_one(reader) 18320 elif tag == 'host_devices': 18321 obj.host_devices = HostDeviceReader.read_many(reader) 18322 elif tag == 'initialization': 18323 obj.initialization = InitializationReader.read_one(reader) 18324 elif tag == 'instance_type': 18325 obj.instance_type = InstanceTypeReader.read_one(reader) 18326 elif tag == 'io': 18327 obj.io = IoReader.read_one(reader) 18328 elif tag == 'katello_errata': 18329 obj.katello_errata = KatelloErratumReader.read_many(reader) 18330 elif tag == 'large_icon': 18331 obj.large_icon = IconReader.read_one(reader) 18332 elif tag == 'lease': 18333 obj.lease = StorageDomainLeaseReader.read_one(reader) 18334 elif tag == 'mediated_devices': 18335 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 18336 elif tag == 'memory': 18337 obj.memory = Reader.read_integer(reader) 18338 elif tag == 'memory_policy': 18339 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18340 elif tag == 'migration': 18341 obj.migration = MigrationOptionsReader.read_one(reader) 18342 elif tag == 'migration_downtime': 18343 obj.migration_downtime = Reader.read_integer(reader) 18344 elif tag == 'multi_queues_enabled': 18345 obj.multi_queues_enabled = Reader.read_boolean(reader) 18346 elif tag == 'name': 18347 obj.name = Reader.read_string(reader) 18348 elif tag == 'next_run_configuration_exists': 18349 obj.next_run_configuration_exists = Reader.read_boolean(reader) 18350 elif tag == 'nics': 18351 obj.nics = NicReader.read_many(reader) 18352 elif tag == 'host_numa_nodes': 18353 obj.numa_nodes = NumaNodeReader.read_many(reader) 18354 elif tag == 'numa_tune_mode': 18355 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18356 elif tag == 'origin': 18357 obj.origin = Reader.read_string(reader) 18358 elif tag == 'original_template': 18359 obj.original_template = TemplateReader.read_one(reader) 18360 elif tag == 'os': 18361 obj.os = OperatingSystemReader.read_one(reader) 18362 elif tag == 'payloads': 18363 obj.payloads = PayloadReader.read_many(reader) 18364 elif tag == 'permissions': 18365 obj.permissions = PermissionReader.read_many(reader) 18366 elif tag == 'placement_policy': 18367 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18368 elif tag == 'quota': 18369 obj.quota = QuotaReader.read_one(reader) 18370 elif tag == 'reported_devices': 18371 obj.reported_devices = ReportedDeviceReader.read_many(reader) 18372 elif tag == 'rng_device': 18373 obj.rng_device = RngDeviceReader.read_one(reader) 18374 elif tag == 'run_once': 18375 obj.run_once = Reader.read_boolean(reader) 18376 elif tag == 'serial_number': 18377 obj.serial_number = SerialNumberReader.read_one(reader) 18378 elif tag == 'sessions': 18379 obj.sessions = SessionReader.read_many(reader) 18380 elif tag == 'small_icon': 18381 obj.small_icon = IconReader.read_one(reader) 18382 elif tag == 'snapshots': 18383 obj.snapshots = SnapshotReader.read_many(reader) 18384 elif tag == 'soundcard_enabled': 18385 obj.soundcard_enabled = Reader.read_boolean(reader) 18386 elif tag == 'sso': 18387 obj.sso = SsoReader.read_one(reader) 18388 elif tag == 'start_paused': 18389 obj.start_paused = Reader.read_boolean(reader) 18390 elif tag == 'start_time': 18391 obj.start_time = Reader.read_date(reader) 18392 elif tag == 'stateless': 18393 obj.stateless = Reader.read_boolean(reader) 18394 elif tag == 'statistics': 18395 obj.statistics = StatisticReader.read_many(reader) 18396 elif tag == 'status': 18397 obj.status = Reader.read_enum(types.VmStatus, reader) 18398 elif tag == 'status_detail': 18399 obj.status_detail = Reader.read_string(reader) 18400 elif tag == 'stop_reason': 18401 obj.stop_reason = Reader.read_string(reader) 18402 elif tag == 'stop_time': 18403 obj.stop_time = Reader.read_date(reader) 18404 elif tag == 'storage_domain': 18405 obj.storage_domain = StorageDomainReader.read_one(reader) 18406 elif tag == 'storage_error_resume_behaviour': 18407 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18408 elif tag == 'tags': 18409 obj.tags = TagReader.read_many(reader) 18410 elif tag == 'template': 18411 obj.template = TemplateReader.read_one(reader) 18412 elif tag == 'time_zone': 18413 obj.time_zone = TimeZoneReader.read_one(reader) 18414 elif tag == 'tpm_enabled': 18415 obj.tpm_enabled = Reader.read_boolean(reader) 18416 elif tag == 'tunnel_migration': 18417 obj.tunnel_migration = Reader.read_boolean(reader) 18418 elif tag == 'type': 18419 obj.type = Reader.read_enum(types.VmType, reader) 18420 elif tag == 'usb': 18421 obj.usb = UsbReader.read_one(reader) 18422 elif tag == 'use_latest_template_version': 18423 obj.use_latest_template_version = Reader.read_boolean(reader) 18424 elif tag == 'virtio_scsi': 18425 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18426 elif tag == 'virtio_scsi_multi_queues': 18427 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18428 elif tag == 'virtio_scsi_multi_queues_enabled': 18429 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18430 elif tag == 'vm_pool': 18431 obj.vm_pool = VmPoolReader.read_one(reader) 18432 elif tag == 'watchdogs': 18433 obj.watchdogs = WatchdogReader.read_many(reader) 18434 elif tag == 'link': 18435 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18436 reader.next_element() 18437 else: 18438 reader.next_element() 18439 for link in links: 18440 VmReader._process_link(link, obj) 18441 18442 # Discard the end tag: 18443 reader.read() 18444 18445 return obj 18446 18447 @staticmethod 18448 def read_many(reader): 18449 # Do nothing if there aren't more tags: 18450 objs = List() 18451 if not reader.forward(): 18452 return objs 18453 18454 # Process the attributes: 18455 objs.href = reader.get_attribute('href') 18456 18457 # Discard the start tag: 18458 empty = reader.empty_element() 18459 reader.read() 18460 if empty: 18461 return objs 18462 18463 # Process the inner elements: 18464 while reader.forward(): 18465 objs.append(VmReader.read_one(reader)) 18466 18467 # Discard the end tag: 18468 reader.read() 18469 18470 return objs 18471 18472 @staticmethod 18473 def _process_link(link, obj): 18474 # Process the attributes: 18475 rel = link[0] 18476 href = link[1] 18477 if href and rel: 18478 if rel == "affinitylabels": 18479 if obj.affinity_labels is not None: 18480 obj.affinity_labels.href = href 18481 else: 18482 obj.affinity_labels = List(href) 18483 elif rel == "applications": 18484 if obj.applications is not None: 18485 obj.applications.href = href 18486 else: 18487 obj.applications = List(href) 18488 elif rel == "cdroms": 18489 if obj.cdroms is not None: 18490 obj.cdroms.href = href 18491 else: 18492 obj.cdroms = List(href) 18493 elif rel == "diskattachments": 18494 if obj.disk_attachments is not None: 18495 obj.disk_attachments.href = href 18496 else: 18497 obj.disk_attachments = List(href) 18498 elif rel == "floppies": 18499 if obj.floppies is not None: 18500 obj.floppies.href = href 18501 else: 18502 obj.floppies = List(href) 18503 elif rel == "graphicsconsoles": 18504 if obj.graphics_consoles is not None: 18505 obj.graphics_consoles.href = href 18506 else: 18507 obj.graphics_consoles = List(href) 18508 elif rel == "hostdevices": 18509 if obj.host_devices is not None: 18510 obj.host_devices.href = href 18511 else: 18512 obj.host_devices = List(href) 18513 elif rel == "katelloerrata": 18514 if obj.katello_errata is not None: 18515 obj.katello_errata.href = href 18516 else: 18517 obj.katello_errata = List(href) 18518 elif rel == "mediateddevices": 18519 if obj.mediated_devices is not None: 18520 obj.mediated_devices.href = href 18521 else: 18522 obj.mediated_devices = List(href) 18523 elif rel == "nics": 18524 if obj.nics is not None: 18525 obj.nics.href = href 18526 else: 18527 obj.nics = List(href) 18528 elif rel == "numanodes": 18529 if obj.numa_nodes is not None: 18530 obj.numa_nodes.href = href 18531 else: 18532 obj.numa_nodes = List(href) 18533 elif rel == "permissions": 18534 if obj.permissions is not None: 18535 obj.permissions.href = href 18536 else: 18537 obj.permissions = List(href) 18538 elif rel == "reporteddevices": 18539 if obj.reported_devices is not None: 18540 obj.reported_devices.href = href 18541 else: 18542 obj.reported_devices = List(href) 18543 elif rel == "sessions": 18544 if obj.sessions is not None: 18545 obj.sessions.href = href 18546 else: 18547 obj.sessions = List(href) 18548 elif rel == "snapshots": 18549 if obj.snapshots is not None: 18550 obj.snapshots.href = href 18551 else: 18552 obj.snapshots = List(href) 18553 elif rel == "statistics": 18554 if obj.statistics is not None: 18555 obj.statistics.href = href 18556 else: 18557 obj.statistics = List(href) 18558 elif rel == "tags": 18559 if obj.tags is not None: 18560 obj.tags.href = href 18561 else: 18562 obj.tags = List(href) 18563 elif rel == "watchdogs": 18564 if obj.watchdogs is not None: 18565 obj.watchdogs.href = href 18566 else: 18567 obj.watchdogs = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18231 @staticmethod 18232 def read_one(reader): 18233 # Do nothing if there aren't more tags: 18234 if not reader.forward(): 18235 return None 18236 18237 # Create the object: 18238 obj = types.Vm() 18239 18240 # Process the attributes: 18241 obj.href = reader.get_attribute('href') 18242 value = reader.get_attribute('id') 18243 if value is not None: 18244 obj.id = value 18245 18246 # Discard the start tag: 18247 empty = reader.empty_element() 18248 reader.read() 18249 if empty: 18250 return obj 18251 18252 # Process the inner elements: 18253 links = [] 18254 while reader.forward(): 18255 tag = reader.node_name() 18256 if tag == 'affinity_labels': 18257 obj.affinity_labels = AffinityLabelReader.read_many(reader) 18258 elif tag == 'applications': 18259 obj.applications = ApplicationReader.read_many(reader) 18260 elif tag == 'auto_pinning_policy': 18261 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18262 elif tag == 'bios': 18263 obj.bios = BiosReader.read_one(reader) 18264 elif tag == 'cdroms': 18265 obj.cdroms = CdromReader.read_many(reader) 18266 elif tag == 'cluster': 18267 obj.cluster = ClusterReader.read_one(reader) 18268 elif tag == 'comment': 18269 obj.comment = Reader.read_string(reader) 18270 elif tag == 'console': 18271 obj.console = ConsoleReader.read_one(reader) 18272 elif tag == 'cpu': 18273 obj.cpu = CpuReader.read_one(reader) 18274 elif tag == 'cpu_pinning_policy': 18275 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18276 elif tag == 'cpu_profile': 18277 obj.cpu_profile = CpuProfileReader.read_one(reader) 18278 elif tag == 'cpu_shares': 18279 obj.cpu_shares = Reader.read_integer(reader) 18280 elif tag == 'creation_time': 18281 obj.creation_time = Reader.read_date(reader) 18282 elif tag == 'custom_compatibility_version': 18283 obj.custom_compatibility_version = VersionReader.read_one(reader) 18284 elif tag == 'custom_cpu_model': 18285 obj.custom_cpu_model = Reader.read_string(reader) 18286 elif tag == 'custom_emulated_machine': 18287 obj.custom_emulated_machine = Reader.read_string(reader) 18288 elif tag == 'custom_properties': 18289 obj.custom_properties = CustomPropertyReader.read_many(reader) 18290 elif tag == 'delete_protected': 18291 obj.delete_protected = Reader.read_boolean(reader) 18292 elif tag == 'description': 18293 obj.description = Reader.read_string(reader) 18294 elif tag == 'disk_attachments': 18295 obj.disk_attachments = DiskAttachmentReader.read_many(reader) 18296 elif tag == 'display': 18297 obj.display = DisplayReader.read_one(reader) 18298 elif tag == 'domain': 18299 obj.domain = DomainReader.read_one(reader) 18300 elif tag == 'dynamic_cpu': 18301 obj.dynamic_cpu = DynamicCpuReader.read_one(reader) 18302 elif tag == 'external_host_provider': 18303 obj.external_host_provider = ExternalHostProviderReader.read_one(reader) 18304 elif tag == 'floppies': 18305 obj.floppies = FloppyReader.read_many(reader) 18306 elif tag == 'fqdn': 18307 obj.fqdn = Reader.read_string(reader) 18308 elif tag == 'graphics_consoles': 18309 obj.graphics_consoles = GraphicsConsoleReader.read_many(reader) 18310 elif tag == 'guest_operating_system': 18311 obj.guest_operating_system = GuestOperatingSystemReader.read_one(reader) 18312 elif tag == 'guest_time_zone': 18313 obj.guest_time_zone = TimeZoneReader.read_one(reader) 18314 elif tag == 'has_illegal_images': 18315 obj.has_illegal_images = Reader.read_boolean(reader) 18316 elif tag == 'high_availability': 18317 obj.high_availability = HighAvailabilityReader.read_one(reader) 18318 elif tag == 'host': 18319 obj.host = HostReader.read_one(reader) 18320 elif tag == 'host_devices': 18321 obj.host_devices = HostDeviceReader.read_many(reader) 18322 elif tag == 'initialization': 18323 obj.initialization = InitializationReader.read_one(reader) 18324 elif tag == 'instance_type': 18325 obj.instance_type = InstanceTypeReader.read_one(reader) 18326 elif tag == 'io': 18327 obj.io = IoReader.read_one(reader) 18328 elif tag == 'katello_errata': 18329 obj.katello_errata = KatelloErratumReader.read_many(reader) 18330 elif tag == 'large_icon': 18331 obj.large_icon = IconReader.read_one(reader) 18332 elif tag == 'lease': 18333 obj.lease = StorageDomainLeaseReader.read_one(reader) 18334 elif tag == 'mediated_devices': 18335 obj.mediated_devices = VmMediatedDeviceReader.read_many(reader) 18336 elif tag == 'memory': 18337 obj.memory = Reader.read_integer(reader) 18338 elif tag == 'memory_policy': 18339 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18340 elif tag == 'migration': 18341 obj.migration = MigrationOptionsReader.read_one(reader) 18342 elif tag == 'migration_downtime': 18343 obj.migration_downtime = Reader.read_integer(reader) 18344 elif tag == 'multi_queues_enabled': 18345 obj.multi_queues_enabled = Reader.read_boolean(reader) 18346 elif tag == 'name': 18347 obj.name = Reader.read_string(reader) 18348 elif tag == 'next_run_configuration_exists': 18349 obj.next_run_configuration_exists = Reader.read_boolean(reader) 18350 elif tag == 'nics': 18351 obj.nics = NicReader.read_many(reader) 18352 elif tag == 'host_numa_nodes': 18353 obj.numa_nodes = NumaNodeReader.read_many(reader) 18354 elif tag == 'numa_tune_mode': 18355 obj.numa_tune_mode = Reader.read_enum(types.NumaTuneMode, reader) 18356 elif tag == 'origin': 18357 obj.origin = Reader.read_string(reader) 18358 elif tag == 'original_template': 18359 obj.original_template = TemplateReader.read_one(reader) 18360 elif tag == 'os': 18361 obj.os = OperatingSystemReader.read_one(reader) 18362 elif tag == 'payloads': 18363 obj.payloads = PayloadReader.read_many(reader) 18364 elif tag == 'permissions': 18365 obj.permissions = PermissionReader.read_many(reader) 18366 elif tag == 'placement_policy': 18367 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18368 elif tag == 'quota': 18369 obj.quota = QuotaReader.read_one(reader) 18370 elif tag == 'reported_devices': 18371 obj.reported_devices = ReportedDeviceReader.read_many(reader) 18372 elif tag == 'rng_device': 18373 obj.rng_device = RngDeviceReader.read_one(reader) 18374 elif tag == 'run_once': 18375 obj.run_once = Reader.read_boolean(reader) 18376 elif tag == 'serial_number': 18377 obj.serial_number = SerialNumberReader.read_one(reader) 18378 elif tag == 'sessions': 18379 obj.sessions = SessionReader.read_many(reader) 18380 elif tag == 'small_icon': 18381 obj.small_icon = IconReader.read_one(reader) 18382 elif tag == 'snapshots': 18383 obj.snapshots = SnapshotReader.read_many(reader) 18384 elif tag == 'soundcard_enabled': 18385 obj.soundcard_enabled = Reader.read_boolean(reader) 18386 elif tag == 'sso': 18387 obj.sso = SsoReader.read_one(reader) 18388 elif tag == 'start_paused': 18389 obj.start_paused = Reader.read_boolean(reader) 18390 elif tag == 'start_time': 18391 obj.start_time = Reader.read_date(reader) 18392 elif tag == 'stateless': 18393 obj.stateless = Reader.read_boolean(reader) 18394 elif tag == 'statistics': 18395 obj.statistics = StatisticReader.read_many(reader) 18396 elif tag == 'status': 18397 obj.status = Reader.read_enum(types.VmStatus, reader) 18398 elif tag == 'status_detail': 18399 obj.status_detail = Reader.read_string(reader) 18400 elif tag == 'stop_reason': 18401 obj.stop_reason = Reader.read_string(reader) 18402 elif tag == 'stop_time': 18403 obj.stop_time = Reader.read_date(reader) 18404 elif tag == 'storage_domain': 18405 obj.storage_domain = StorageDomainReader.read_one(reader) 18406 elif tag == 'storage_error_resume_behaviour': 18407 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18408 elif tag == 'tags': 18409 obj.tags = TagReader.read_many(reader) 18410 elif tag == 'template': 18411 obj.template = TemplateReader.read_one(reader) 18412 elif tag == 'time_zone': 18413 obj.time_zone = TimeZoneReader.read_one(reader) 18414 elif tag == 'tpm_enabled': 18415 obj.tpm_enabled = Reader.read_boolean(reader) 18416 elif tag == 'tunnel_migration': 18417 obj.tunnel_migration = Reader.read_boolean(reader) 18418 elif tag == 'type': 18419 obj.type = Reader.read_enum(types.VmType, reader) 18420 elif tag == 'usb': 18421 obj.usb = UsbReader.read_one(reader) 18422 elif tag == 'use_latest_template_version': 18423 obj.use_latest_template_version = Reader.read_boolean(reader) 18424 elif tag == 'virtio_scsi': 18425 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18426 elif tag == 'virtio_scsi_multi_queues': 18427 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18428 elif tag == 'virtio_scsi_multi_queues_enabled': 18429 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18430 elif tag == 'vm_pool': 18431 obj.vm_pool = VmPoolReader.read_one(reader) 18432 elif tag == 'watchdogs': 18433 obj.watchdogs = WatchdogReader.read_many(reader) 18434 elif tag == 'link': 18435 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18436 reader.next_element() 18437 else: 18438 reader.next_element() 18439 for link in links: 18440 VmReader._process_link(link, obj) 18441 18442 # Discard the end tag: 18443 reader.read() 18444 18445 return obj
18447 @staticmethod 18448 def read_many(reader): 18449 # Do nothing if there aren't more tags: 18450 objs = List() 18451 if not reader.forward(): 18452 return objs 18453 18454 # Process the attributes: 18455 objs.href = reader.get_attribute('href') 18456 18457 # Discard the start tag: 18458 empty = reader.empty_element() 18459 reader.read() 18460 if empty: 18461 return objs 18462 18463 # Process the inner elements: 18464 while reader.forward(): 18465 objs.append(VmReader.read_one(reader)) 18466 18467 # Discard the end tag: 18468 reader.read() 18469 18470 return objs
18570class VmBaseReader(Reader): 18571 18572 def __init__(self): 18573 super(VmBaseReader, self).__init__() 18574 18575 @staticmethod 18576 def read_one(reader): 18577 # Do nothing if there aren't more tags: 18578 if not reader.forward(): 18579 return None 18580 18581 # Create the object: 18582 obj = types.VmBase() 18583 18584 # Process the attributes: 18585 obj.href = reader.get_attribute('href') 18586 value = reader.get_attribute('id') 18587 if value is not None: 18588 obj.id = value 18589 18590 # Discard the start tag: 18591 empty = reader.empty_element() 18592 reader.read() 18593 if empty: 18594 return obj 18595 18596 # Process the inner elements: 18597 links = [] 18598 while reader.forward(): 18599 tag = reader.node_name() 18600 if tag == 'auto_pinning_policy': 18601 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18602 elif tag == 'bios': 18603 obj.bios = BiosReader.read_one(reader) 18604 elif tag == 'cluster': 18605 obj.cluster = ClusterReader.read_one(reader) 18606 elif tag == 'comment': 18607 obj.comment = Reader.read_string(reader) 18608 elif tag == 'console': 18609 obj.console = ConsoleReader.read_one(reader) 18610 elif tag == 'cpu': 18611 obj.cpu = CpuReader.read_one(reader) 18612 elif tag == 'cpu_pinning_policy': 18613 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18614 elif tag == 'cpu_profile': 18615 obj.cpu_profile = CpuProfileReader.read_one(reader) 18616 elif tag == 'cpu_shares': 18617 obj.cpu_shares = Reader.read_integer(reader) 18618 elif tag == 'creation_time': 18619 obj.creation_time = Reader.read_date(reader) 18620 elif tag == 'custom_compatibility_version': 18621 obj.custom_compatibility_version = VersionReader.read_one(reader) 18622 elif tag == 'custom_cpu_model': 18623 obj.custom_cpu_model = Reader.read_string(reader) 18624 elif tag == 'custom_emulated_machine': 18625 obj.custom_emulated_machine = Reader.read_string(reader) 18626 elif tag == 'custom_properties': 18627 obj.custom_properties = CustomPropertyReader.read_many(reader) 18628 elif tag == 'delete_protected': 18629 obj.delete_protected = Reader.read_boolean(reader) 18630 elif tag == 'description': 18631 obj.description = Reader.read_string(reader) 18632 elif tag == 'display': 18633 obj.display = DisplayReader.read_one(reader) 18634 elif tag == 'domain': 18635 obj.domain = DomainReader.read_one(reader) 18636 elif tag == 'high_availability': 18637 obj.high_availability = HighAvailabilityReader.read_one(reader) 18638 elif tag == 'initialization': 18639 obj.initialization = InitializationReader.read_one(reader) 18640 elif tag == 'io': 18641 obj.io = IoReader.read_one(reader) 18642 elif tag == 'large_icon': 18643 obj.large_icon = IconReader.read_one(reader) 18644 elif tag == 'lease': 18645 obj.lease = StorageDomainLeaseReader.read_one(reader) 18646 elif tag == 'memory': 18647 obj.memory = Reader.read_integer(reader) 18648 elif tag == 'memory_policy': 18649 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18650 elif tag == 'migration': 18651 obj.migration = MigrationOptionsReader.read_one(reader) 18652 elif tag == 'migration_downtime': 18653 obj.migration_downtime = Reader.read_integer(reader) 18654 elif tag == 'multi_queues_enabled': 18655 obj.multi_queues_enabled = Reader.read_boolean(reader) 18656 elif tag == 'name': 18657 obj.name = Reader.read_string(reader) 18658 elif tag == 'origin': 18659 obj.origin = Reader.read_string(reader) 18660 elif tag == 'os': 18661 obj.os = OperatingSystemReader.read_one(reader) 18662 elif tag == 'placement_policy': 18663 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18664 elif tag == 'quota': 18665 obj.quota = QuotaReader.read_one(reader) 18666 elif tag == 'rng_device': 18667 obj.rng_device = RngDeviceReader.read_one(reader) 18668 elif tag == 'serial_number': 18669 obj.serial_number = SerialNumberReader.read_one(reader) 18670 elif tag == 'small_icon': 18671 obj.small_icon = IconReader.read_one(reader) 18672 elif tag == 'soundcard_enabled': 18673 obj.soundcard_enabled = Reader.read_boolean(reader) 18674 elif tag == 'sso': 18675 obj.sso = SsoReader.read_one(reader) 18676 elif tag == 'start_paused': 18677 obj.start_paused = Reader.read_boolean(reader) 18678 elif tag == 'stateless': 18679 obj.stateless = Reader.read_boolean(reader) 18680 elif tag == 'storage_domain': 18681 obj.storage_domain = StorageDomainReader.read_one(reader) 18682 elif tag == 'storage_error_resume_behaviour': 18683 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18684 elif tag == 'time_zone': 18685 obj.time_zone = TimeZoneReader.read_one(reader) 18686 elif tag == 'tpm_enabled': 18687 obj.tpm_enabled = Reader.read_boolean(reader) 18688 elif tag == 'tunnel_migration': 18689 obj.tunnel_migration = Reader.read_boolean(reader) 18690 elif tag == 'type': 18691 obj.type = Reader.read_enum(types.VmType, reader) 18692 elif tag == 'usb': 18693 obj.usb = UsbReader.read_one(reader) 18694 elif tag == 'virtio_scsi': 18695 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18696 elif tag == 'virtio_scsi_multi_queues': 18697 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18698 elif tag == 'virtio_scsi_multi_queues_enabled': 18699 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18700 else: 18701 reader.next_element() 18702 for link in links: 18703 VmBaseReader._process_link(link, obj) 18704 18705 # Discard the end tag: 18706 reader.read() 18707 18708 return obj 18709 18710 @staticmethod 18711 def read_many(reader): 18712 # Do nothing if there aren't more tags: 18713 objs = List() 18714 if not reader.forward(): 18715 return objs 18716 18717 # Process the attributes: 18718 objs.href = reader.get_attribute('href') 18719 18720 # Discard the start tag: 18721 empty = reader.empty_element() 18722 reader.read() 18723 if empty: 18724 return objs 18725 18726 # Process the inner elements: 18727 while reader.forward(): 18728 objs.append(VmBaseReader.read_one(reader)) 18729 18730 # Discard the end tag: 18731 reader.read() 18732 18733 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18575 @staticmethod 18576 def read_one(reader): 18577 # Do nothing if there aren't more tags: 18578 if not reader.forward(): 18579 return None 18580 18581 # Create the object: 18582 obj = types.VmBase() 18583 18584 # Process the attributes: 18585 obj.href = reader.get_attribute('href') 18586 value = reader.get_attribute('id') 18587 if value is not None: 18588 obj.id = value 18589 18590 # Discard the start tag: 18591 empty = reader.empty_element() 18592 reader.read() 18593 if empty: 18594 return obj 18595 18596 # Process the inner elements: 18597 links = [] 18598 while reader.forward(): 18599 tag = reader.node_name() 18600 if tag == 'auto_pinning_policy': 18601 obj.auto_pinning_policy = Reader.read_enum(types.AutoPinningPolicy, reader) 18602 elif tag == 'bios': 18603 obj.bios = BiosReader.read_one(reader) 18604 elif tag == 'cluster': 18605 obj.cluster = ClusterReader.read_one(reader) 18606 elif tag == 'comment': 18607 obj.comment = Reader.read_string(reader) 18608 elif tag == 'console': 18609 obj.console = ConsoleReader.read_one(reader) 18610 elif tag == 'cpu': 18611 obj.cpu = CpuReader.read_one(reader) 18612 elif tag == 'cpu_pinning_policy': 18613 obj.cpu_pinning_policy = Reader.read_enum(types.CpuPinningPolicy, reader) 18614 elif tag == 'cpu_profile': 18615 obj.cpu_profile = CpuProfileReader.read_one(reader) 18616 elif tag == 'cpu_shares': 18617 obj.cpu_shares = Reader.read_integer(reader) 18618 elif tag == 'creation_time': 18619 obj.creation_time = Reader.read_date(reader) 18620 elif tag == 'custom_compatibility_version': 18621 obj.custom_compatibility_version = VersionReader.read_one(reader) 18622 elif tag == 'custom_cpu_model': 18623 obj.custom_cpu_model = Reader.read_string(reader) 18624 elif tag == 'custom_emulated_machine': 18625 obj.custom_emulated_machine = Reader.read_string(reader) 18626 elif tag == 'custom_properties': 18627 obj.custom_properties = CustomPropertyReader.read_many(reader) 18628 elif tag == 'delete_protected': 18629 obj.delete_protected = Reader.read_boolean(reader) 18630 elif tag == 'description': 18631 obj.description = Reader.read_string(reader) 18632 elif tag == 'display': 18633 obj.display = DisplayReader.read_one(reader) 18634 elif tag == 'domain': 18635 obj.domain = DomainReader.read_one(reader) 18636 elif tag == 'high_availability': 18637 obj.high_availability = HighAvailabilityReader.read_one(reader) 18638 elif tag == 'initialization': 18639 obj.initialization = InitializationReader.read_one(reader) 18640 elif tag == 'io': 18641 obj.io = IoReader.read_one(reader) 18642 elif tag == 'large_icon': 18643 obj.large_icon = IconReader.read_one(reader) 18644 elif tag == 'lease': 18645 obj.lease = StorageDomainLeaseReader.read_one(reader) 18646 elif tag == 'memory': 18647 obj.memory = Reader.read_integer(reader) 18648 elif tag == 'memory_policy': 18649 obj.memory_policy = MemoryPolicyReader.read_one(reader) 18650 elif tag == 'migration': 18651 obj.migration = MigrationOptionsReader.read_one(reader) 18652 elif tag == 'migration_downtime': 18653 obj.migration_downtime = Reader.read_integer(reader) 18654 elif tag == 'multi_queues_enabled': 18655 obj.multi_queues_enabled = Reader.read_boolean(reader) 18656 elif tag == 'name': 18657 obj.name = Reader.read_string(reader) 18658 elif tag == 'origin': 18659 obj.origin = Reader.read_string(reader) 18660 elif tag == 'os': 18661 obj.os = OperatingSystemReader.read_one(reader) 18662 elif tag == 'placement_policy': 18663 obj.placement_policy = VmPlacementPolicyReader.read_one(reader) 18664 elif tag == 'quota': 18665 obj.quota = QuotaReader.read_one(reader) 18666 elif tag == 'rng_device': 18667 obj.rng_device = RngDeviceReader.read_one(reader) 18668 elif tag == 'serial_number': 18669 obj.serial_number = SerialNumberReader.read_one(reader) 18670 elif tag == 'small_icon': 18671 obj.small_icon = IconReader.read_one(reader) 18672 elif tag == 'soundcard_enabled': 18673 obj.soundcard_enabled = Reader.read_boolean(reader) 18674 elif tag == 'sso': 18675 obj.sso = SsoReader.read_one(reader) 18676 elif tag == 'start_paused': 18677 obj.start_paused = Reader.read_boolean(reader) 18678 elif tag == 'stateless': 18679 obj.stateless = Reader.read_boolean(reader) 18680 elif tag == 'storage_domain': 18681 obj.storage_domain = StorageDomainReader.read_one(reader) 18682 elif tag == 'storage_error_resume_behaviour': 18683 obj.storage_error_resume_behaviour = Reader.read_enum(types.VmStorageErrorResumeBehaviour, reader) 18684 elif tag == 'time_zone': 18685 obj.time_zone = TimeZoneReader.read_one(reader) 18686 elif tag == 'tpm_enabled': 18687 obj.tpm_enabled = Reader.read_boolean(reader) 18688 elif tag == 'tunnel_migration': 18689 obj.tunnel_migration = Reader.read_boolean(reader) 18690 elif tag == 'type': 18691 obj.type = Reader.read_enum(types.VmType, reader) 18692 elif tag == 'usb': 18693 obj.usb = UsbReader.read_one(reader) 18694 elif tag == 'virtio_scsi': 18695 obj.virtio_scsi = VirtioScsiReader.read_one(reader) 18696 elif tag == 'virtio_scsi_multi_queues': 18697 obj.virtio_scsi_multi_queues = Reader.read_integer(reader) 18698 elif tag == 'virtio_scsi_multi_queues_enabled': 18699 obj.virtio_scsi_multi_queues_enabled = Reader.read_boolean(reader) 18700 else: 18701 reader.next_element() 18702 for link in links: 18703 VmBaseReader._process_link(link, obj) 18704 18705 # Discard the end tag: 18706 reader.read() 18707 18708 return obj
18710 @staticmethod 18711 def read_many(reader): 18712 # Do nothing if there aren't more tags: 18713 objs = List() 18714 if not reader.forward(): 18715 return objs 18716 18717 # Process the attributes: 18718 objs.href = reader.get_attribute('href') 18719 18720 # Discard the start tag: 18721 empty = reader.empty_element() 18722 reader.read() 18723 if empty: 18724 return objs 18725 18726 # Process the inner elements: 18727 while reader.forward(): 18728 objs.append(VmBaseReader.read_one(reader)) 18729 18730 # Discard the end tag: 18731 reader.read() 18732 18733 return objs
18736class VmMediatedDeviceReader(Reader): 18737 18738 def __init__(self): 18739 super(VmMediatedDeviceReader, self).__init__() 18740 18741 @staticmethod 18742 def read_one(reader): 18743 # Do nothing if there aren't more tags: 18744 if not reader.forward(): 18745 return None 18746 18747 # Create the object: 18748 obj = types.VmMediatedDevice() 18749 18750 # Process the attributes: 18751 obj.href = reader.get_attribute('href') 18752 value = reader.get_attribute('id') 18753 if value is not None: 18754 obj.id = value 18755 18756 # Discard the start tag: 18757 empty = reader.empty_element() 18758 reader.read() 18759 if empty: 18760 return obj 18761 18762 # Process the inner elements: 18763 links = [] 18764 while reader.forward(): 18765 tag = reader.node_name() 18766 if tag == 'comment': 18767 obj.comment = Reader.read_string(reader) 18768 elif tag == 'description': 18769 obj.description = Reader.read_string(reader) 18770 elif tag == 'instance_type': 18771 obj.instance_type = InstanceTypeReader.read_one(reader) 18772 elif tag == 'name': 18773 obj.name = Reader.read_string(reader) 18774 elif tag == 'spec_params': 18775 obj.spec_params = PropertyReader.read_many(reader) 18776 elif tag == 'template': 18777 obj.template = TemplateReader.read_one(reader) 18778 elif tag == 'vm': 18779 obj.vm = VmReader.read_one(reader) 18780 elif tag == 'vms': 18781 obj.vms = VmReader.read_many(reader) 18782 elif tag == 'link': 18783 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18784 reader.next_element() 18785 else: 18786 reader.next_element() 18787 for link in links: 18788 VmMediatedDeviceReader._process_link(link, obj) 18789 18790 # Discard the end tag: 18791 reader.read() 18792 18793 return obj 18794 18795 @staticmethod 18796 def read_many(reader): 18797 # Do nothing if there aren't more tags: 18798 objs = List() 18799 if not reader.forward(): 18800 return objs 18801 18802 # Process the attributes: 18803 objs.href = reader.get_attribute('href') 18804 18805 # Discard the start tag: 18806 empty = reader.empty_element() 18807 reader.read() 18808 if empty: 18809 return objs 18810 18811 # Process the inner elements: 18812 while reader.forward(): 18813 objs.append(VmMediatedDeviceReader.read_one(reader)) 18814 18815 # Discard the end tag: 18816 reader.read() 18817 18818 return objs 18819 18820 @staticmethod 18821 def _process_link(link, obj): 18822 # Process the attributes: 18823 rel = link[0] 18824 href = link[1] 18825 if href and rel: 18826 if rel == "vms": 18827 if obj.vms is not None: 18828 obj.vms.href = href 18829 else: 18830 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18741 @staticmethod 18742 def read_one(reader): 18743 # Do nothing if there aren't more tags: 18744 if not reader.forward(): 18745 return None 18746 18747 # Create the object: 18748 obj = types.VmMediatedDevice() 18749 18750 # Process the attributes: 18751 obj.href = reader.get_attribute('href') 18752 value = reader.get_attribute('id') 18753 if value is not None: 18754 obj.id = value 18755 18756 # Discard the start tag: 18757 empty = reader.empty_element() 18758 reader.read() 18759 if empty: 18760 return obj 18761 18762 # Process the inner elements: 18763 links = [] 18764 while reader.forward(): 18765 tag = reader.node_name() 18766 if tag == 'comment': 18767 obj.comment = Reader.read_string(reader) 18768 elif tag == 'description': 18769 obj.description = Reader.read_string(reader) 18770 elif tag == 'instance_type': 18771 obj.instance_type = InstanceTypeReader.read_one(reader) 18772 elif tag == 'name': 18773 obj.name = Reader.read_string(reader) 18774 elif tag == 'spec_params': 18775 obj.spec_params = PropertyReader.read_many(reader) 18776 elif tag == 'template': 18777 obj.template = TemplateReader.read_one(reader) 18778 elif tag == 'vm': 18779 obj.vm = VmReader.read_one(reader) 18780 elif tag == 'vms': 18781 obj.vms = VmReader.read_many(reader) 18782 elif tag == 'link': 18783 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18784 reader.next_element() 18785 else: 18786 reader.next_element() 18787 for link in links: 18788 VmMediatedDeviceReader._process_link(link, obj) 18789 18790 # Discard the end tag: 18791 reader.read() 18792 18793 return obj
18795 @staticmethod 18796 def read_many(reader): 18797 # Do nothing if there aren't more tags: 18798 objs = List() 18799 if not reader.forward(): 18800 return objs 18801 18802 # Process the attributes: 18803 objs.href = reader.get_attribute('href') 18804 18805 # Discard the start tag: 18806 empty = reader.empty_element() 18807 reader.read() 18808 if empty: 18809 return objs 18810 18811 # Process the inner elements: 18812 while reader.forward(): 18813 objs.append(VmMediatedDeviceReader.read_one(reader)) 18814 18815 # Discard the end tag: 18816 reader.read() 18817 18818 return objs
18833class VmPlacementPolicyReader(Reader): 18834 18835 def __init__(self): 18836 super(VmPlacementPolicyReader, self).__init__() 18837 18838 @staticmethod 18839 def read_one(reader): 18840 # Do nothing if there aren't more tags: 18841 if not reader.forward(): 18842 return None 18843 18844 # Create the object: 18845 obj = types.VmPlacementPolicy() 18846 18847 # Process the attributes: 18848 obj.href = reader.get_attribute('href') 18849 18850 # Discard the start tag: 18851 empty = reader.empty_element() 18852 reader.read() 18853 if empty: 18854 return obj 18855 18856 # Process the inner elements: 18857 links = [] 18858 while reader.forward(): 18859 tag = reader.node_name() 18860 if tag == 'affinity': 18861 obj.affinity = Reader.read_enum(types.VmAffinity, reader) 18862 elif tag == 'hosts': 18863 obj.hosts = HostReader.read_many(reader) 18864 elif tag == 'link': 18865 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18866 reader.next_element() 18867 else: 18868 reader.next_element() 18869 for link in links: 18870 VmPlacementPolicyReader._process_link(link, obj) 18871 18872 # Discard the end tag: 18873 reader.read() 18874 18875 return obj 18876 18877 @staticmethod 18878 def read_many(reader): 18879 # Do nothing if there aren't more tags: 18880 objs = List() 18881 if not reader.forward(): 18882 return objs 18883 18884 # Process the attributes: 18885 objs.href = reader.get_attribute('href') 18886 18887 # Discard the start tag: 18888 empty = reader.empty_element() 18889 reader.read() 18890 if empty: 18891 return objs 18892 18893 # Process the inner elements: 18894 while reader.forward(): 18895 objs.append(VmPlacementPolicyReader.read_one(reader)) 18896 18897 # Discard the end tag: 18898 reader.read() 18899 18900 return objs 18901 18902 @staticmethod 18903 def _process_link(link, obj): 18904 # Process the attributes: 18905 rel = link[0] 18906 href = link[1] 18907 if href and rel: 18908 if rel == "hosts": 18909 if obj.hosts is not None: 18910 obj.hosts.href = href 18911 else: 18912 obj.hosts = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18838 @staticmethod 18839 def read_one(reader): 18840 # Do nothing if there aren't more tags: 18841 if not reader.forward(): 18842 return None 18843 18844 # Create the object: 18845 obj = types.VmPlacementPolicy() 18846 18847 # Process the attributes: 18848 obj.href = reader.get_attribute('href') 18849 18850 # Discard the start tag: 18851 empty = reader.empty_element() 18852 reader.read() 18853 if empty: 18854 return obj 18855 18856 # Process the inner elements: 18857 links = [] 18858 while reader.forward(): 18859 tag = reader.node_name() 18860 if tag == 'affinity': 18861 obj.affinity = Reader.read_enum(types.VmAffinity, reader) 18862 elif tag == 'hosts': 18863 obj.hosts = HostReader.read_many(reader) 18864 elif tag == 'link': 18865 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18866 reader.next_element() 18867 else: 18868 reader.next_element() 18869 for link in links: 18870 VmPlacementPolicyReader._process_link(link, obj) 18871 18872 # Discard the end tag: 18873 reader.read() 18874 18875 return obj
18877 @staticmethod 18878 def read_many(reader): 18879 # Do nothing if there aren't more tags: 18880 objs = List() 18881 if not reader.forward(): 18882 return objs 18883 18884 # Process the attributes: 18885 objs.href = reader.get_attribute('href') 18886 18887 # Discard the start tag: 18888 empty = reader.empty_element() 18889 reader.read() 18890 if empty: 18891 return objs 18892 18893 # Process the inner elements: 18894 while reader.forward(): 18895 objs.append(VmPlacementPolicyReader.read_one(reader)) 18896 18897 # Discard the end tag: 18898 reader.read() 18899 18900 return objs
18915class VmPoolReader(Reader): 18916 18917 def __init__(self): 18918 super(VmPoolReader, self).__init__() 18919 18920 @staticmethod 18921 def read_one(reader): 18922 # Do nothing if there aren't more tags: 18923 if not reader.forward(): 18924 return None 18925 18926 # Create the object: 18927 obj = types.VmPool() 18928 18929 # Process the attributes: 18930 obj.href = reader.get_attribute('href') 18931 value = reader.get_attribute('id') 18932 if value is not None: 18933 obj.id = value 18934 18935 # Discard the start tag: 18936 empty = reader.empty_element() 18937 reader.read() 18938 if empty: 18939 return obj 18940 18941 # Process the inner elements: 18942 links = [] 18943 while reader.forward(): 18944 tag = reader.node_name() 18945 if tag == 'auto_storage_select': 18946 obj.auto_storage_select = Reader.read_boolean(reader) 18947 elif tag == 'cluster': 18948 obj.cluster = ClusterReader.read_one(reader) 18949 elif tag == 'comment': 18950 obj.comment = Reader.read_string(reader) 18951 elif tag == 'description': 18952 obj.description = Reader.read_string(reader) 18953 elif tag == 'display': 18954 obj.display = DisplayReader.read_one(reader) 18955 elif tag == 'instance_type': 18956 obj.instance_type = InstanceTypeReader.read_one(reader) 18957 elif tag == 'max_user_vms': 18958 obj.max_user_vms = Reader.read_integer(reader) 18959 elif tag == 'name': 18960 obj.name = Reader.read_string(reader) 18961 elif tag == 'permissions': 18962 obj.permissions = PermissionReader.read_many(reader) 18963 elif tag == 'prestarted_vms': 18964 obj.prestarted_vms = Reader.read_integer(reader) 18965 elif tag == 'rng_device': 18966 obj.rng_device = RngDeviceReader.read_one(reader) 18967 elif tag == 'size': 18968 obj.size = Reader.read_integer(reader) 18969 elif tag == 'soundcard_enabled': 18970 obj.soundcard_enabled = Reader.read_boolean(reader) 18971 elif tag == 'stateful': 18972 obj.stateful = Reader.read_boolean(reader) 18973 elif tag == 'template': 18974 obj.template = TemplateReader.read_one(reader) 18975 elif tag == 'tpm_enabled': 18976 obj.tpm_enabled = Reader.read_boolean(reader) 18977 elif tag == 'type': 18978 obj.type = Reader.read_enum(types.VmPoolType, reader) 18979 elif tag == 'use_latest_template_version': 18980 obj.use_latest_template_version = Reader.read_boolean(reader) 18981 elif tag == 'vm': 18982 obj.vm = VmReader.read_one(reader) 18983 elif tag == 'link': 18984 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18985 reader.next_element() 18986 else: 18987 reader.next_element() 18988 for link in links: 18989 VmPoolReader._process_link(link, obj) 18990 18991 # Discard the end tag: 18992 reader.read() 18993 18994 return obj 18995 18996 @staticmethod 18997 def read_many(reader): 18998 # Do nothing if there aren't more tags: 18999 objs = List() 19000 if not reader.forward(): 19001 return objs 19002 19003 # Process the attributes: 19004 objs.href = reader.get_attribute('href') 19005 19006 # Discard the start tag: 19007 empty = reader.empty_element() 19008 reader.read() 19009 if empty: 19010 return objs 19011 19012 # Process the inner elements: 19013 while reader.forward(): 19014 objs.append(VmPoolReader.read_one(reader)) 19015 19016 # Discard the end tag: 19017 reader.read() 19018 19019 return objs 19020 19021 @staticmethod 19022 def _process_link(link, obj): 19023 # Process the attributes: 19024 rel = link[0] 19025 href = link[1] 19026 if href and rel: 19027 if rel == "permissions": 19028 if obj.permissions is not None: 19029 obj.permissions.href = href 19030 else: 19031 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
18920 @staticmethod 18921 def read_one(reader): 18922 # Do nothing if there aren't more tags: 18923 if not reader.forward(): 18924 return None 18925 18926 # Create the object: 18927 obj = types.VmPool() 18928 18929 # Process the attributes: 18930 obj.href = reader.get_attribute('href') 18931 value = reader.get_attribute('id') 18932 if value is not None: 18933 obj.id = value 18934 18935 # Discard the start tag: 18936 empty = reader.empty_element() 18937 reader.read() 18938 if empty: 18939 return obj 18940 18941 # Process the inner elements: 18942 links = [] 18943 while reader.forward(): 18944 tag = reader.node_name() 18945 if tag == 'auto_storage_select': 18946 obj.auto_storage_select = Reader.read_boolean(reader) 18947 elif tag == 'cluster': 18948 obj.cluster = ClusterReader.read_one(reader) 18949 elif tag == 'comment': 18950 obj.comment = Reader.read_string(reader) 18951 elif tag == 'description': 18952 obj.description = Reader.read_string(reader) 18953 elif tag == 'display': 18954 obj.display = DisplayReader.read_one(reader) 18955 elif tag == 'instance_type': 18956 obj.instance_type = InstanceTypeReader.read_one(reader) 18957 elif tag == 'max_user_vms': 18958 obj.max_user_vms = Reader.read_integer(reader) 18959 elif tag == 'name': 18960 obj.name = Reader.read_string(reader) 18961 elif tag == 'permissions': 18962 obj.permissions = PermissionReader.read_many(reader) 18963 elif tag == 'prestarted_vms': 18964 obj.prestarted_vms = Reader.read_integer(reader) 18965 elif tag == 'rng_device': 18966 obj.rng_device = RngDeviceReader.read_one(reader) 18967 elif tag == 'size': 18968 obj.size = Reader.read_integer(reader) 18969 elif tag == 'soundcard_enabled': 18970 obj.soundcard_enabled = Reader.read_boolean(reader) 18971 elif tag == 'stateful': 18972 obj.stateful = Reader.read_boolean(reader) 18973 elif tag == 'template': 18974 obj.template = TemplateReader.read_one(reader) 18975 elif tag == 'tpm_enabled': 18976 obj.tpm_enabled = Reader.read_boolean(reader) 18977 elif tag == 'type': 18978 obj.type = Reader.read_enum(types.VmPoolType, reader) 18979 elif tag == 'use_latest_template_version': 18980 obj.use_latest_template_version = Reader.read_boolean(reader) 18981 elif tag == 'vm': 18982 obj.vm = VmReader.read_one(reader) 18983 elif tag == 'link': 18984 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 18985 reader.next_element() 18986 else: 18987 reader.next_element() 18988 for link in links: 18989 VmPoolReader._process_link(link, obj) 18990 18991 # Discard the end tag: 18992 reader.read() 18993 18994 return obj
18996 @staticmethod 18997 def read_many(reader): 18998 # Do nothing if there aren't more tags: 18999 objs = List() 19000 if not reader.forward(): 19001 return objs 19002 19003 # Process the attributes: 19004 objs.href = reader.get_attribute('href') 19005 19006 # Discard the start tag: 19007 empty = reader.empty_element() 19008 reader.read() 19009 if empty: 19010 return objs 19011 19012 # Process the inner elements: 19013 while reader.forward(): 19014 objs.append(VmPoolReader.read_one(reader)) 19015 19016 # Discard the end tag: 19017 reader.read() 19018 19019 return objs
19034class VmSummaryReader(Reader): 19035 19036 def __init__(self): 19037 super(VmSummaryReader, self).__init__() 19038 19039 @staticmethod 19040 def read_one(reader): 19041 # Do nothing if there aren't more tags: 19042 if not reader.forward(): 19043 return None 19044 19045 # Create the object: 19046 obj = types.VmSummary() 19047 19048 # Process the attributes: 19049 obj.href = reader.get_attribute('href') 19050 19051 # Discard the start tag: 19052 empty = reader.empty_element() 19053 reader.read() 19054 if empty: 19055 return obj 19056 19057 # Process the inner elements: 19058 links = [] 19059 while reader.forward(): 19060 tag = reader.node_name() 19061 if tag == 'active': 19062 obj.active = Reader.read_integer(reader) 19063 elif tag == 'migrating': 19064 obj.migrating = Reader.read_integer(reader) 19065 elif tag == 'total': 19066 obj.total = Reader.read_integer(reader) 19067 else: 19068 reader.next_element() 19069 for link in links: 19070 VmSummaryReader._process_link(link, obj) 19071 19072 # Discard the end tag: 19073 reader.read() 19074 19075 return obj 19076 19077 @staticmethod 19078 def read_many(reader): 19079 # Do nothing if there aren't more tags: 19080 objs = List() 19081 if not reader.forward(): 19082 return objs 19083 19084 # Process the attributes: 19085 objs.href = reader.get_attribute('href') 19086 19087 # Discard the start tag: 19088 empty = reader.empty_element() 19089 reader.read() 19090 if empty: 19091 return objs 19092 19093 # Process the inner elements: 19094 while reader.forward(): 19095 objs.append(VmSummaryReader.read_one(reader)) 19096 19097 # Discard the end tag: 19098 reader.read() 19099 19100 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19039 @staticmethod 19040 def read_one(reader): 19041 # Do nothing if there aren't more tags: 19042 if not reader.forward(): 19043 return None 19044 19045 # Create the object: 19046 obj = types.VmSummary() 19047 19048 # Process the attributes: 19049 obj.href = reader.get_attribute('href') 19050 19051 # Discard the start tag: 19052 empty = reader.empty_element() 19053 reader.read() 19054 if empty: 19055 return obj 19056 19057 # Process the inner elements: 19058 links = [] 19059 while reader.forward(): 19060 tag = reader.node_name() 19061 if tag == 'active': 19062 obj.active = Reader.read_integer(reader) 19063 elif tag == 'migrating': 19064 obj.migrating = Reader.read_integer(reader) 19065 elif tag == 'total': 19066 obj.total = Reader.read_integer(reader) 19067 else: 19068 reader.next_element() 19069 for link in links: 19070 VmSummaryReader._process_link(link, obj) 19071 19072 # Discard the end tag: 19073 reader.read() 19074 19075 return obj
19077 @staticmethod 19078 def read_many(reader): 19079 # Do nothing if there aren't more tags: 19080 objs = List() 19081 if not reader.forward(): 19082 return objs 19083 19084 # Process the attributes: 19085 objs.href = reader.get_attribute('href') 19086 19087 # Discard the start tag: 19088 empty = reader.empty_element() 19089 reader.read() 19090 if empty: 19091 return objs 19092 19093 # Process the inner elements: 19094 while reader.forward(): 19095 objs.append(VmSummaryReader.read_one(reader)) 19096 19097 # Discard the end tag: 19098 reader.read() 19099 19100 return objs
19103class VnicPassThroughReader(Reader): 19104 19105 def __init__(self): 19106 super(VnicPassThroughReader, self).__init__() 19107 19108 @staticmethod 19109 def read_one(reader): 19110 # Do nothing if there aren't more tags: 19111 if not reader.forward(): 19112 return None 19113 19114 # Create the object: 19115 obj = types.VnicPassThrough() 19116 19117 # Process the attributes: 19118 obj.href = reader.get_attribute('href') 19119 19120 # Discard the start tag: 19121 empty = reader.empty_element() 19122 reader.read() 19123 if empty: 19124 return obj 19125 19126 # Process the inner elements: 19127 links = [] 19128 while reader.forward(): 19129 tag = reader.node_name() 19130 if tag == 'mode': 19131 obj.mode = Reader.read_enum(types.VnicPassThroughMode, reader) 19132 else: 19133 reader.next_element() 19134 for link in links: 19135 VnicPassThroughReader._process_link(link, obj) 19136 19137 # Discard the end tag: 19138 reader.read() 19139 19140 return obj 19141 19142 @staticmethod 19143 def read_many(reader): 19144 # Do nothing if there aren't more tags: 19145 objs = List() 19146 if not reader.forward(): 19147 return objs 19148 19149 # Process the attributes: 19150 objs.href = reader.get_attribute('href') 19151 19152 # Discard the start tag: 19153 empty = reader.empty_element() 19154 reader.read() 19155 if empty: 19156 return objs 19157 19158 # Process the inner elements: 19159 while reader.forward(): 19160 objs.append(VnicPassThroughReader.read_one(reader)) 19161 19162 # Discard the end tag: 19163 reader.read() 19164 19165 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19108 @staticmethod 19109 def read_one(reader): 19110 # Do nothing if there aren't more tags: 19111 if not reader.forward(): 19112 return None 19113 19114 # Create the object: 19115 obj = types.VnicPassThrough() 19116 19117 # Process the attributes: 19118 obj.href = reader.get_attribute('href') 19119 19120 # Discard the start tag: 19121 empty = reader.empty_element() 19122 reader.read() 19123 if empty: 19124 return obj 19125 19126 # Process the inner elements: 19127 links = [] 19128 while reader.forward(): 19129 tag = reader.node_name() 19130 if tag == 'mode': 19131 obj.mode = Reader.read_enum(types.VnicPassThroughMode, reader) 19132 else: 19133 reader.next_element() 19134 for link in links: 19135 VnicPassThroughReader._process_link(link, obj) 19136 19137 # Discard the end tag: 19138 reader.read() 19139 19140 return obj
19142 @staticmethod 19143 def read_many(reader): 19144 # Do nothing if there aren't more tags: 19145 objs = List() 19146 if not reader.forward(): 19147 return objs 19148 19149 # Process the attributes: 19150 objs.href = reader.get_attribute('href') 19151 19152 # Discard the start tag: 19153 empty = reader.empty_element() 19154 reader.read() 19155 if empty: 19156 return objs 19157 19158 # Process the inner elements: 19159 while reader.forward(): 19160 objs.append(VnicPassThroughReader.read_one(reader)) 19161 19162 # Discard the end tag: 19163 reader.read() 19164 19165 return objs
19168class VnicProfileReader(Reader): 19169 19170 def __init__(self): 19171 super(VnicProfileReader, self).__init__() 19172 19173 @staticmethod 19174 def read_one(reader): 19175 # Do nothing if there aren't more tags: 19176 if not reader.forward(): 19177 return None 19178 19179 # Create the object: 19180 obj = types.VnicProfile() 19181 19182 # Process the attributes: 19183 obj.href = reader.get_attribute('href') 19184 value = reader.get_attribute('id') 19185 if value is not None: 19186 obj.id = value 19187 19188 # Discard the start tag: 19189 empty = reader.empty_element() 19190 reader.read() 19191 if empty: 19192 return obj 19193 19194 # Process the inner elements: 19195 links = [] 19196 while reader.forward(): 19197 tag = reader.node_name() 19198 if tag == 'comment': 19199 obj.comment = Reader.read_string(reader) 19200 elif tag == 'custom_properties': 19201 obj.custom_properties = CustomPropertyReader.read_many(reader) 19202 elif tag == 'description': 19203 obj.description = Reader.read_string(reader) 19204 elif tag == 'failover': 19205 obj.failover = VnicProfileReader.read_one(reader) 19206 elif tag == 'migratable': 19207 obj.migratable = Reader.read_boolean(reader) 19208 elif tag == 'name': 19209 obj.name = Reader.read_string(reader) 19210 elif tag == 'network': 19211 obj.network = NetworkReader.read_one(reader) 19212 elif tag == 'network_filter': 19213 obj.network_filter = NetworkFilterReader.read_one(reader) 19214 elif tag == 'pass_through': 19215 obj.pass_through = VnicPassThroughReader.read_one(reader) 19216 elif tag == 'permissions': 19217 obj.permissions = PermissionReader.read_many(reader) 19218 elif tag == 'port_mirroring': 19219 obj.port_mirroring = Reader.read_boolean(reader) 19220 elif tag == 'qos': 19221 obj.qos = QosReader.read_one(reader) 19222 elif tag == 'link': 19223 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19224 reader.next_element() 19225 else: 19226 reader.next_element() 19227 for link in links: 19228 VnicProfileReader._process_link(link, obj) 19229 19230 # Discard the end tag: 19231 reader.read() 19232 19233 return obj 19234 19235 @staticmethod 19236 def read_many(reader): 19237 # Do nothing if there aren't more tags: 19238 objs = List() 19239 if not reader.forward(): 19240 return objs 19241 19242 # Process the attributes: 19243 objs.href = reader.get_attribute('href') 19244 19245 # Discard the start tag: 19246 empty = reader.empty_element() 19247 reader.read() 19248 if empty: 19249 return objs 19250 19251 # Process the inner elements: 19252 while reader.forward(): 19253 objs.append(VnicProfileReader.read_one(reader)) 19254 19255 # Discard the end tag: 19256 reader.read() 19257 19258 return objs 19259 19260 @staticmethod 19261 def _process_link(link, obj): 19262 # Process the attributes: 19263 rel = link[0] 19264 href = link[1] 19265 if href and rel: 19266 if rel == "permissions": 19267 if obj.permissions is not None: 19268 obj.permissions.href = href 19269 else: 19270 obj.permissions = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19173 @staticmethod 19174 def read_one(reader): 19175 # Do nothing if there aren't more tags: 19176 if not reader.forward(): 19177 return None 19178 19179 # Create the object: 19180 obj = types.VnicProfile() 19181 19182 # Process the attributes: 19183 obj.href = reader.get_attribute('href') 19184 value = reader.get_attribute('id') 19185 if value is not None: 19186 obj.id = value 19187 19188 # Discard the start tag: 19189 empty = reader.empty_element() 19190 reader.read() 19191 if empty: 19192 return obj 19193 19194 # Process the inner elements: 19195 links = [] 19196 while reader.forward(): 19197 tag = reader.node_name() 19198 if tag == 'comment': 19199 obj.comment = Reader.read_string(reader) 19200 elif tag == 'custom_properties': 19201 obj.custom_properties = CustomPropertyReader.read_many(reader) 19202 elif tag == 'description': 19203 obj.description = Reader.read_string(reader) 19204 elif tag == 'failover': 19205 obj.failover = VnicProfileReader.read_one(reader) 19206 elif tag == 'migratable': 19207 obj.migratable = Reader.read_boolean(reader) 19208 elif tag == 'name': 19209 obj.name = Reader.read_string(reader) 19210 elif tag == 'network': 19211 obj.network = NetworkReader.read_one(reader) 19212 elif tag == 'network_filter': 19213 obj.network_filter = NetworkFilterReader.read_one(reader) 19214 elif tag == 'pass_through': 19215 obj.pass_through = VnicPassThroughReader.read_one(reader) 19216 elif tag == 'permissions': 19217 obj.permissions = PermissionReader.read_many(reader) 19218 elif tag == 'port_mirroring': 19219 obj.port_mirroring = Reader.read_boolean(reader) 19220 elif tag == 'qos': 19221 obj.qos = QosReader.read_one(reader) 19222 elif tag == 'link': 19223 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19224 reader.next_element() 19225 else: 19226 reader.next_element() 19227 for link in links: 19228 VnicProfileReader._process_link(link, obj) 19229 19230 # Discard the end tag: 19231 reader.read() 19232 19233 return obj
19235 @staticmethod 19236 def read_many(reader): 19237 # Do nothing if there aren't more tags: 19238 objs = List() 19239 if not reader.forward(): 19240 return objs 19241 19242 # Process the attributes: 19243 objs.href = reader.get_attribute('href') 19244 19245 # Discard the start tag: 19246 empty = reader.empty_element() 19247 reader.read() 19248 if empty: 19249 return objs 19250 19251 # Process the inner elements: 19252 while reader.forward(): 19253 objs.append(VnicProfileReader.read_one(reader)) 19254 19255 # Discard the end tag: 19256 reader.read() 19257 19258 return objs
19273class VnicProfileMappingReader(Reader): 19274 19275 def __init__(self): 19276 super(VnicProfileMappingReader, self).__init__() 19277 19278 @staticmethod 19279 def read_one(reader): 19280 # Do nothing if there aren't more tags: 19281 if not reader.forward(): 19282 return None 19283 19284 # Create the object: 19285 obj = types.VnicProfileMapping() 19286 19287 # Process the attributes: 19288 obj.href = reader.get_attribute('href') 19289 19290 # Discard the start tag: 19291 empty = reader.empty_element() 19292 reader.read() 19293 if empty: 19294 return obj 19295 19296 # Process the inner elements: 19297 links = [] 19298 while reader.forward(): 19299 tag = reader.node_name() 19300 if tag == 'source_network_name': 19301 obj.source_network_name = Reader.read_string(reader) 19302 elif tag == 'source_network_profile_name': 19303 obj.source_network_profile_name = Reader.read_string(reader) 19304 elif tag == 'target_vnic_profile': 19305 obj.target_vnic_profile = VnicProfileReader.read_one(reader) 19306 else: 19307 reader.next_element() 19308 for link in links: 19309 VnicProfileMappingReader._process_link(link, obj) 19310 19311 # Discard the end tag: 19312 reader.read() 19313 19314 return obj 19315 19316 @staticmethod 19317 def read_many(reader): 19318 # Do nothing if there aren't more tags: 19319 objs = List() 19320 if not reader.forward(): 19321 return objs 19322 19323 # Process the attributes: 19324 objs.href = reader.get_attribute('href') 19325 19326 # Discard the start tag: 19327 empty = reader.empty_element() 19328 reader.read() 19329 if empty: 19330 return objs 19331 19332 # Process the inner elements: 19333 while reader.forward(): 19334 objs.append(VnicProfileMappingReader.read_one(reader)) 19335 19336 # Discard the end tag: 19337 reader.read() 19338 19339 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19278 @staticmethod 19279 def read_one(reader): 19280 # Do nothing if there aren't more tags: 19281 if not reader.forward(): 19282 return None 19283 19284 # Create the object: 19285 obj = types.VnicProfileMapping() 19286 19287 # Process the attributes: 19288 obj.href = reader.get_attribute('href') 19289 19290 # Discard the start tag: 19291 empty = reader.empty_element() 19292 reader.read() 19293 if empty: 19294 return obj 19295 19296 # Process the inner elements: 19297 links = [] 19298 while reader.forward(): 19299 tag = reader.node_name() 19300 if tag == 'source_network_name': 19301 obj.source_network_name = Reader.read_string(reader) 19302 elif tag == 'source_network_profile_name': 19303 obj.source_network_profile_name = Reader.read_string(reader) 19304 elif tag == 'target_vnic_profile': 19305 obj.target_vnic_profile = VnicProfileReader.read_one(reader) 19306 else: 19307 reader.next_element() 19308 for link in links: 19309 VnicProfileMappingReader._process_link(link, obj) 19310 19311 # Discard the end tag: 19312 reader.read() 19313 19314 return obj
19316 @staticmethod 19317 def read_many(reader): 19318 # Do nothing if there aren't more tags: 19319 objs = List() 19320 if not reader.forward(): 19321 return objs 19322 19323 # Process the attributes: 19324 objs.href = reader.get_attribute('href') 19325 19326 # Discard the start tag: 19327 empty = reader.empty_element() 19328 reader.read() 19329 if empty: 19330 return objs 19331 19332 # Process the inner elements: 19333 while reader.forward(): 19334 objs.append(VnicProfileMappingReader.read_one(reader)) 19335 19336 # Discard the end tag: 19337 reader.read() 19338 19339 return objs
19342class VolumeGroupReader(Reader): 19343 19344 def __init__(self): 19345 super(VolumeGroupReader, self).__init__() 19346 19347 @staticmethod 19348 def read_one(reader): 19349 # Do nothing if there aren't more tags: 19350 if not reader.forward(): 19351 return None 19352 19353 # Create the object: 19354 obj = types.VolumeGroup() 19355 19356 # Process the attributes: 19357 obj.href = reader.get_attribute('href') 19358 value = reader.get_attribute('id') 19359 if value is not None: 19360 obj.id = value 19361 19362 # Discard the start tag: 19363 empty = reader.empty_element() 19364 reader.read() 19365 if empty: 19366 return obj 19367 19368 # Process the inner elements: 19369 links = [] 19370 while reader.forward(): 19371 tag = reader.node_name() 19372 if tag == 'logical_units': 19373 obj.logical_units = LogicalUnitReader.read_many(reader) 19374 elif tag == 'name': 19375 obj.name = Reader.read_string(reader) 19376 else: 19377 reader.next_element() 19378 for link in links: 19379 VolumeGroupReader._process_link(link, obj) 19380 19381 # Discard the end tag: 19382 reader.read() 19383 19384 return obj 19385 19386 @staticmethod 19387 def read_many(reader): 19388 # Do nothing if there aren't more tags: 19389 objs = List() 19390 if not reader.forward(): 19391 return objs 19392 19393 # Process the attributes: 19394 objs.href = reader.get_attribute('href') 19395 19396 # Discard the start tag: 19397 empty = reader.empty_element() 19398 reader.read() 19399 if empty: 19400 return objs 19401 19402 # Process the inner elements: 19403 while reader.forward(): 19404 objs.append(VolumeGroupReader.read_one(reader)) 19405 19406 # Discard the end tag: 19407 reader.read() 19408 19409 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19347 @staticmethod 19348 def read_one(reader): 19349 # Do nothing if there aren't more tags: 19350 if not reader.forward(): 19351 return None 19352 19353 # Create the object: 19354 obj = types.VolumeGroup() 19355 19356 # Process the attributes: 19357 obj.href = reader.get_attribute('href') 19358 value = reader.get_attribute('id') 19359 if value is not None: 19360 obj.id = value 19361 19362 # Discard the start tag: 19363 empty = reader.empty_element() 19364 reader.read() 19365 if empty: 19366 return obj 19367 19368 # Process the inner elements: 19369 links = [] 19370 while reader.forward(): 19371 tag = reader.node_name() 19372 if tag == 'logical_units': 19373 obj.logical_units = LogicalUnitReader.read_many(reader) 19374 elif tag == 'name': 19375 obj.name = Reader.read_string(reader) 19376 else: 19377 reader.next_element() 19378 for link in links: 19379 VolumeGroupReader._process_link(link, obj) 19380 19381 # Discard the end tag: 19382 reader.read() 19383 19384 return obj
19386 @staticmethod 19387 def read_many(reader): 19388 # Do nothing if there aren't more tags: 19389 objs = List() 19390 if not reader.forward(): 19391 return objs 19392 19393 # Process the attributes: 19394 objs.href = reader.get_attribute('href') 19395 19396 # Discard the start tag: 19397 empty = reader.empty_element() 19398 reader.read() 19399 if empty: 19400 return objs 19401 19402 # Process the inner elements: 19403 while reader.forward(): 19404 objs.append(VolumeGroupReader.read_one(reader)) 19405 19406 # Discard the end tag: 19407 reader.read() 19408 19409 return objs
19412class WatchdogReader(Reader): 19413 19414 def __init__(self): 19415 super(WatchdogReader, self).__init__() 19416 19417 @staticmethod 19418 def read_one(reader): 19419 # Do nothing if there aren't more tags: 19420 if not reader.forward(): 19421 return None 19422 19423 # Create the object: 19424 obj = types.Watchdog() 19425 19426 # Process the attributes: 19427 obj.href = reader.get_attribute('href') 19428 value = reader.get_attribute('id') 19429 if value is not None: 19430 obj.id = value 19431 19432 # Discard the start tag: 19433 empty = reader.empty_element() 19434 reader.read() 19435 if empty: 19436 return obj 19437 19438 # Process the inner elements: 19439 links = [] 19440 while reader.forward(): 19441 tag = reader.node_name() 19442 if tag == 'action': 19443 obj.action = Reader.read_enum(types.WatchdogAction, reader) 19444 elif tag == 'comment': 19445 obj.comment = Reader.read_string(reader) 19446 elif tag == 'description': 19447 obj.description = Reader.read_string(reader) 19448 elif tag == 'instance_type': 19449 obj.instance_type = InstanceTypeReader.read_one(reader) 19450 elif tag == 'model': 19451 obj.model = Reader.read_enum(types.WatchdogModel, reader) 19452 elif tag == 'name': 19453 obj.name = Reader.read_string(reader) 19454 elif tag == 'template': 19455 obj.template = TemplateReader.read_one(reader) 19456 elif tag == 'vm': 19457 obj.vm = VmReader.read_one(reader) 19458 elif tag == 'vms': 19459 obj.vms = VmReader.read_many(reader) 19460 elif tag == 'link': 19461 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19462 reader.next_element() 19463 else: 19464 reader.next_element() 19465 for link in links: 19466 WatchdogReader._process_link(link, obj) 19467 19468 # Discard the end tag: 19469 reader.read() 19470 19471 return obj 19472 19473 @staticmethod 19474 def read_many(reader): 19475 # Do nothing if there aren't more tags: 19476 objs = List() 19477 if not reader.forward(): 19478 return objs 19479 19480 # Process the attributes: 19481 objs.href = reader.get_attribute('href') 19482 19483 # Discard the start tag: 19484 empty = reader.empty_element() 19485 reader.read() 19486 if empty: 19487 return objs 19488 19489 # Process the inner elements: 19490 while reader.forward(): 19491 objs.append(WatchdogReader.read_one(reader)) 19492 19493 # Discard the end tag: 19494 reader.read() 19495 19496 return objs 19497 19498 @staticmethod 19499 def _process_link(link, obj): 19500 # Process the attributes: 19501 rel = link[0] 19502 href = link[1] 19503 if href and rel: 19504 if rel == "vms": 19505 if obj.vms is not None: 19506 obj.vms.href = href 19507 else: 19508 obj.vms = List(href)
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19417 @staticmethod 19418 def read_one(reader): 19419 # Do nothing if there aren't more tags: 19420 if not reader.forward(): 19421 return None 19422 19423 # Create the object: 19424 obj = types.Watchdog() 19425 19426 # Process the attributes: 19427 obj.href = reader.get_attribute('href') 19428 value = reader.get_attribute('id') 19429 if value is not None: 19430 obj.id = value 19431 19432 # Discard the start tag: 19433 empty = reader.empty_element() 19434 reader.read() 19435 if empty: 19436 return obj 19437 19438 # Process the inner elements: 19439 links = [] 19440 while reader.forward(): 19441 tag = reader.node_name() 19442 if tag == 'action': 19443 obj.action = Reader.read_enum(types.WatchdogAction, reader) 19444 elif tag == 'comment': 19445 obj.comment = Reader.read_string(reader) 19446 elif tag == 'description': 19447 obj.description = Reader.read_string(reader) 19448 elif tag == 'instance_type': 19449 obj.instance_type = InstanceTypeReader.read_one(reader) 19450 elif tag == 'model': 19451 obj.model = Reader.read_enum(types.WatchdogModel, reader) 19452 elif tag == 'name': 19453 obj.name = Reader.read_string(reader) 19454 elif tag == 'template': 19455 obj.template = TemplateReader.read_one(reader) 19456 elif tag == 'vm': 19457 obj.vm = VmReader.read_one(reader) 19458 elif tag == 'vms': 19459 obj.vms = VmReader.read_many(reader) 19460 elif tag == 'link': 19461 links.append((reader.get_attribute('rel'), reader.get_attribute('href'))) 19462 reader.next_element() 19463 else: 19464 reader.next_element() 19465 for link in links: 19466 WatchdogReader._process_link(link, obj) 19467 19468 # Discard the end tag: 19469 reader.read() 19470 19471 return obj
19473 @staticmethod 19474 def read_many(reader): 19475 # Do nothing if there aren't more tags: 19476 objs = List() 19477 if not reader.forward(): 19478 return objs 19479 19480 # Process the attributes: 19481 objs.href = reader.get_attribute('href') 19482 19483 # Discard the start tag: 19484 empty = reader.empty_element() 19485 reader.read() 19486 if empty: 19487 return objs 19488 19489 # Process the inner elements: 19490 while reader.forward(): 19491 objs.append(WatchdogReader.read_one(reader)) 19492 19493 # Discard the end tag: 19494 reader.read() 19495 19496 return objs
19511class WeightReader(Reader): 19512 19513 def __init__(self): 19514 super(WeightReader, self).__init__() 19515 19516 @staticmethod 19517 def read_one(reader): 19518 # Do nothing if there aren't more tags: 19519 if not reader.forward(): 19520 return None 19521 19522 # Create the object: 19523 obj = types.Weight() 19524 19525 # Process the attributes: 19526 obj.href = reader.get_attribute('href') 19527 value = reader.get_attribute('id') 19528 if value is not None: 19529 obj.id = value 19530 19531 # Discard the start tag: 19532 empty = reader.empty_element() 19533 reader.read() 19534 if empty: 19535 return obj 19536 19537 # Process the inner elements: 19538 links = [] 19539 while reader.forward(): 19540 tag = reader.node_name() 19541 if tag == 'comment': 19542 obj.comment = Reader.read_string(reader) 19543 elif tag == 'description': 19544 obj.description = Reader.read_string(reader) 19545 elif tag == 'factor': 19546 obj.factor = Reader.read_integer(reader) 19547 elif tag == 'name': 19548 obj.name = Reader.read_string(reader) 19549 elif tag == 'scheduling_policy': 19550 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 19551 elif tag == 'scheduling_policy_unit': 19552 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 19553 else: 19554 reader.next_element() 19555 for link in links: 19556 WeightReader._process_link(link, obj) 19557 19558 # Discard the end tag: 19559 reader.read() 19560 19561 return obj 19562 19563 @staticmethod 19564 def read_many(reader): 19565 # Do nothing if there aren't more tags: 19566 objs = List() 19567 if not reader.forward(): 19568 return objs 19569 19570 # Process the attributes: 19571 objs.href = reader.get_attribute('href') 19572 19573 # Discard the start tag: 19574 empty = reader.empty_element() 19575 reader.read() 19576 if empty: 19577 return objs 19578 19579 # Process the inner elements: 19580 while reader.forward(): 19581 objs.append(WeightReader.read_one(reader)) 19582 19583 # Discard the end tag: 19584 reader.read() 19585 19586 return objs
This is the base class for all the readers of the SDK. It contains the utility methods used by all of them.
19516 @staticmethod 19517 def read_one(reader): 19518 # Do nothing if there aren't more tags: 19519 if not reader.forward(): 19520 return None 19521 19522 # Create the object: 19523 obj = types.Weight() 19524 19525 # Process the attributes: 19526 obj.href = reader.get_attribute('href') 19527 value = reader.get_attribute('id') 19528 if value is not None: 19529 obj.id = value 19530 19531 # Discard the start tag: 19532 empty = reader.empty_element() 19533 reader.read() 19534 if empty: 19535 return obj 19536 19537 # Process the inner elements: 19538 links = [] 19539 while reader.forward(): 19540 tag = reader.node_name() 19541 if tag == 'comment': 19542 obj.comment = Reader.read_string(reader) 19543 elif tag == 'description': 19544 obj.description = Reader.read_string(reader) 19545 elif tag == 'factor': 19546 obj.factor = Reader.read_integer(reader) 19547 elif tag == 'name': 19548 obj.name = Reader.read_string(reader) 19549 elif tag == 'scheduling_policy': 19550 obj.scheduling_policy = SchedulingPolicyReader.read_one(reader) 19551 elif tag == 'scheduling_policy_unit': 19552 obj.scheduling_policy_unit = SchedulingPolicyUnitReader.read_one(reader) 19553 else: 19554 reader.next_element() 19555 for link in links: 19556 WeightReader._process_link(link, obj) 19557 19558 # Discard the end tag: 19559 reader.read() 19560 19561 return obj
19563 @staticmethod 19564 def read_many(reader): 19565 # Do nothing if there aren't more tags: 19566 objs = List() 19567 if not reader.forward(): 19568 return objs 19569 19570 # Process the attributes: 19571 objs.href = reader.get_attribute('href') 19572 19573 # Discard the start tag: 19574 empty = reader.empty_element() 19575 reader.read() 19576 if empty: 19577 return objs 19578 19579 # Process the inner elements: 19580 while reader.forward(): 19581 objs.append(WeightReader.read_one(reader)) 19582 19583 # Discard the end tag: 19584 reader.read() 19585 19586 return objs